Skip to content

Commit

Permalink
\x1f should be escaped in json
Browse files Browse the repository at this point in the history
Might help with
divvun/divvun-gramcheck-web#23

https://tools.ietf.org/html/rfc7159 says "escape U+0000 through
U+001F", we were escaping up to but not including 1F, simple fix :)
  • Loading branch information
unhammer committed Dec 18, 2020
1 parent 1ecfe54 commit 0feadcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ inline const std::string esc(const std::u16string& str) {
default:
auto ci = (int)c;
if((sizeof(c) == 1 || static_cast<unsigned>(c) < 256)
&& (ci<0x1f ||
&& (ci<=0x1f ||
ci==0x7f ||
(ci>=0x80 && ci<=0x9f) ||
c == '\\' ||
Expand Down

0 comments on commit 0feadcb

Please sign in to comment.