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/ext handles isolated escaped surrogates inconsistently #38

Closed
mernen opened this issue Jul 28, 2010 · 1 comment
Closed

json/ext handles isolated escaped surrogates inconsistently #38

mernen opened this issue Jul 28, 2010 · 1 comment

Comments

@mernen
Copy link
Contributor

mernen commented Jul 28, 2010

Using json 1.4.3, Ruby 1.8.7p174 and 1.9.2-preview1.

When given a high surrogate with no low surrogate, it gives nil for the string:

JSON.parse(%q{[123,"x\uD834x"]}    # => [123, nil]

When given a low surrogate with no high surrogate, it treats it as a valid character:

JSON.parse %q{[123,"x\uDD5Ex"]}    # => [123, "x\355\265\236x"]

In both cases, json/pure throws JSON::GeneratorErrors due to iconv's strictness (IllegalSequence on OS X, InvalidCharacter on Linux).

@hsbt
Copy link
Collaborator

hsbt commented Jun 25, 2020

Ruby 1.x is EOL at 2020.

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

No branches or pull requests

2 participants