-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Labels
Description
Description of the problem
Jury can not view code with non-UTF-8 encoding code (and diff with it)
The string to escape is not a valid UTF-8 string in "jury/partials/submission_diff.html.twig" at line 72.
Your environment
- DOMjudge version 9.0 or later (with Monaco Editor)
- Debian 13
- Nginx
Steps to reproduce
- Team or jury submit a code with non-UTF-8 encoded source code. (This may happen in some local contest, some team may type some non-ascii character in their source code)
- Jury view the code.
Expected behaviour
It should be shown either in the correct encoding or force display in UTF-8 encoding.
At the very least, it shouldn't be a 500 error; the code can't be displayed at all.
Actual behaviour
Jury can view the code.
Any other information that you want to share?
I have repro this in demoweb now. See https://www.domjudge.org/demoweb/jury/submissions/9677/source
It is also happened in our last weekend ICPC Regional Contest (only one jury test submission with Chinese GBK-encoded comment in his code and submit from his Windows laptop), and I have a db-dump.
If more information is needed, I can provide it via slack DM.