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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JSON.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ tokenize () {
if echo "test string" | egrep -o "test" >/dev/null 2>&1
then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
CHAR='([^[:cntrl:]"\\]|)'
Copy link
Author

Choose a reason for hiding this comment

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

Pay no attention to the UTF-8 behind the curtain...

image

else
GREP=awk_egrep
ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\\\]'
CHAR='([^[:cntrl:]"\\\\]|\x7F)'
fi

local STRING="\"$CHAR*($ESCAPE$CHAR*)*\""
Expand Down
1 change: 1 addition & 0 deletions test/valid/string_with_unescaped_chars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"₀򂂀𝌆"
1 change: 1 addition & 0 deletions test/valid/string_with_unescaped_chars.parsed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[] "₀򂂀𝌆"