Skip to content
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

Json \u escape sequence was not case insensitive #1770

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

tomatosalat0
Copy link
Contributor

When a JSON strings contains the escape sequence \uXXX, the JSON parser only converted it properly if the hexadecimal characters A-F where in lower case.

This means, \u003C would get converted to a different character compared to \u003c.

The method IsHexDigit allows both versions - upper and lower case characters. The .IndexOf() did return -1 for upper case characters resulting in an invalid conversion.

Tests where added for this case.

Copy link
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@lahma lahma merged commit ac2b527 into sebastienros:main Feb 2, 2024
3 checks passed
@tomatosalat0 tomatosalat0 deleted the fix-json-hex-string-parsing branch February 2, 2024 10:32
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.

None yet

2 participants