Skip to content

COMMON: Fix Unicode support in JSON #6601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chkuendig
Copy link
Member

JSON allows for keys and string values to be unicode encoded. Currently all non-ASCI characters are stripped by JSON::untaintContents and replaced with dots. This breaks access to files in cloud which have a unicode in the path (in my case it was Ultima IV™).

This PR removes JSON::untaintContents and replaces it with JSON::zeroTerminateContents and fixes a check to ignore char < 0 (which are all values >255 that overflow in a signed char to negative).

This was discussed also in detail on Discord earlier today: https://discord.com/channels/581224060529148060/711242520415174666/1369945380292395049. With @lephilousophe recommending changing this check instead of moving to unsigned chars.

@chkuendig chkuendig changed the title COMMON: Fix UTF support in JSON COMMON: Fix Unicode support in JSON May 8, 2025
@chkuendig chkuendig requested a review from lephilousophe May 18, 2025 08:57
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.

1 participant