Skip to content

Conversation

@Kevinjil
Copy link
Contributor

Try to reencode the submission source if it currently is not valid in UTF-8. Add some extra safeguard by forcing another sanity check reencode from UTF-8 to UTF-8, which filters out binary blobs.

Before:
image

After:
image

Blobs still filtered out:
image

Fixes #3217

Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss this in person, this might be a proper fix but I'm not sure if we should change submissions for participants (out of principle)

So mostly blocking merging now.

@meisterT
Copy link
Member

This is not changing submissions. It is changing the display of submissions. The submissions it changes would not be displayed previously, see bug and screenshot

1 similar comment
@meisterT
Copy link
Member

This is not changing submissions. It is changing the display of submissions. The submissions it changes would not be displayed previously, see bug and screenshot

@Kevinjil Kevinjil changed the title Reencode submission source in UTF-8 Reencode submission source in UTF-8 when displaying in monaco Nov 25, 2025
@Kevinjil
Copy link
Contributor Author

Let's discuss this in person

As we'll meet this week anyway, I don't see a reason not to discuss in person so I'll wait with merging.

@vmcj
Copy link
Member

vmcj commented Nov 25, 2025

This is not changing submissions. It is changing the display of submissions. The submissions it changes would not be displayed previously, see bug and screenshot

Wrongly read this as that we do this on import.

@Kevinjil
Copy link
Contributor Author

I'll postpone merging this until after a small in-person discussion about #3217 (comment)

@Kevinjil Kevinjil force-pushed the reencode-utf8 branch 2 times, most recently from e2e68fc to 4c25407 Compare November 27, 2025 10:06
@Kevinjil Kevinjil force-pushed the reencode-utf8 branch 3 times, most recently from 15145f6 to 7fda4e8 Compare November 27, 2025 10:36
Try to re-encode the submission source if it currently is not valid in
UTF-8. Add some extra safeguard by forcing another sanity check re-encode
from UTF-8 to the original encoding, which filters out binary blobs and
verifies that the re-encoding is non-destructive.
@Kevinjil Kevinjil enabled auto-merge November 27, 2025 14:20
@Kevinjil Kevinjil added this pull request to the merge queue Nov 27, 2025
Merged via the queue into DOMjudge:main with commit c97ff7a Nov 27, 2025
37 checks passed
@Kevinjil Kevinjil deleted the reencode-utf8 branch November 27, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 Internal Error when jury view code with non-UTF-8 encoding code.

4 participants