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

octal escapes not tested #136

Open
smcv opened this issue Oct 14, 2024 · 0 comments · May be fixed by #137
Open

octal escapes not tested #136

smcv opened this issue Oct 14, 2024 · 0 comments · May be fixed by #137

Comments

@smcv
Copy link

smcv commented Oct 14, 2024

In JavaScript, "\012" or equivalently "\12" is a deprecated way to spell "\u000a" (same as "\012" or "\x0a" in C). In JSON, it's an undefined (hence invalid) escape sequence, just like "\x".

Different parsers might implement this differently (for example json-glib historically accepted "\012" as an extension) so it seems worthwhile to include in the test corpus.

smcv added a commit to smcv/JSONTestSuite that referenced this issue Oct 15, 2024
In standardized JSON, this is an error. In JavaScript, it's a deprecated
alternate spelling for `"\u000a"` (012 octal = 0x000a hex), and some
parsers like the one in json-glib (when not in strict mode) accept this
as an extension beyond standard JSON.

Resolves: nst#136
Signed-off-by: Simon McVittie <[email protected]>
@smcv smcv linked a pull request Oct 15, 2024 that will close this issue
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 a pull request may close this issue.

1 participant