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.sh cannot parse strings with the character DEL 0x7F inside #46

Open
nst opened this Issue Oct 12, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@nst

nst commented Oct 12, 2016

Step to reproduce

$ echo $'["\x7F"]' | ./JSON.sh

Expected behaviour

According to RFC 7159, character DEL 0x7F is perfectly valid unescaped.

JSON.sh should parse the string and print:

[0] "\x7F"
[]  ["\x7F"]

Actual behaviour

JSON.sh cannot parse the string and prints an error:

EXPECTED value GOT "

The issue comes from the fact that JSON.sh uses cntrl to recognize control characters in regular expressions, and cntrl includes DEL 0x7F, while JSON control characters (the one that MUST be escaped) only go from U+0000 to U+001F and don't include U+007F.

@dominictarr

This comment has been minimized.

Show comment
Hide comment
@dominictarr

dominictarr Oct 13, 2016

Owner

so we only need to change this?
https://github.com/dominictarr/JSON.sh/blob/master/JSON.sh#L85-L90

do you want to make a pull request?

Owner

dominictarr commented Oct 13, 2016

so we only need to change this?
https://github.com/dominictarr/JSON.sh/blob/master/JSON.sh#L85-L90

do you want to make a pull request?

gibson042 added a commit to gibson042/JSON.sh that referenced this issue Oct 27, 2016

@gibson042 gibson042 referenced a pull request that will close this issue Oct 27, 2016

Open

Accept unescaped U+007F DELETE per RFC 7159 #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment