diff --git a/JSON.sh b/JSON.sh index 0778633..19cdc6b 100755 --- a/JSON.sh +++ b/JSON.sh @@ -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:]"\\]|)' else GREP=awk_egrep ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})' - CHAR='[^[:cntrl:]"\\\\]' + CHAR='([^[:cntrl:]"\\\\]|\x7F)' fi local STRING="\"$CHAR*($ESCAPE$CHAR*)*\"" diff --git a/test/valid/string_with_unescaped_chars.json b/test/valid/string_with_unescaped_chars.json new file mode 100644 index 0000000..37c30dd --- /dev/null +++ b/test/valid/string_with_unescaped_chars.json @@ -0,0 +1 @@ +"₀򂂀𝌆" diff --git a/test/valid/string_with_unescaped_chars.parsed b/test/valid/string_with_unescaped_chars.parsed new file mode 100644 index 0000000..422bae5 --- /dev/null +++ b/test/valid/string_with_unescaped_chars.parsed @@ -0,0 +1 @@ +[] "₀򂂀𝌆"