-
Notifications
You must be signed in to change notification settings - Fork 339
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
bugfix json/pure mixing escaped with literal unicode raises Encoding::CompatibilityError #483
Conversation
this would fix #232 (opened 7 years ago) |
@notEthan haha looks like you beat me to it: #484 Did you run into this in https://github.com/json-schema-org/JSON-Schema-Test-Suite/ as well? At least we came up with the same fix :) |
remarkable, the very same. my implementation is here: https://github.com/notEthan/jsi . I've just merged (but not yet released) support for validating on its own. it would be cool to have a chat someplace if you'd be interested. |
That sounds good to me. Feel free to send me an email ([email protected]) and we can figure something out. |
I also ran into this bug and came up with the same fix as you two. It would be great to get this merged 🤞 |
hey @hsbt! sorry for the noise but if you get a chance could this PR be considered? |
@notEthan Can you rebase this from the master branch? I'm not sure why this pr didn't invoke our CI. |
…rcing encoding back to ASCII_8BIT before gsubing back into parse_string result
9abafed
to
766f816
Compare
rebased. the CI doesn't run because I am a first-time contributor. I see the message:
|
@notEthan Thanks, I approved it now. |
Truffleruby's version of json/pure has a bug that's triggered by these files. It's been fixed but the fix isn't in Truffleruby yet: - ruby/json#483 - ruby/json#484 This skips the files when the error is raised and drops them before checking fixtures.
Truffleruby's version of json/pure has a bug that's triggered by these files. It's been fixed but the fix isn't in Truffleruby yet: - ruby/json#483 - ruby/json#484 This skips the files when the error is raised and drops them before checking fixtures.
The [fix](ruby/json#483) must've made it fully into Truffleruby now, because this isn't failing anymore.
mixing \u-escaped unicode with literal unicode characters, like so:
results in this error:
which comes from here:
I think that forcing the encoding of the gsub result back to ASCII_8BIT is a good fix for this since the StringScanner string is forced to ASCII_8BIT. I can't be entirely certain though; the handling of encoding in this parser is a bit beyond me.