Skip to content

Commit 0feadcb

Browse files
committed
\x1f should be escaped in json
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 :)
1 parent 1ecfe54 commit 0feadcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ inline const std::string esc(const std::u16string& str) {
5959
default:
6060
auto ci = (int)c;
6161
if((sizeof(c) == 1 || static_cast<unsigned>(c) < 256)
62-
&& (ci<0x1f ||
62+
&& (ci<=0x1f ||
6363
ci==0x7f ||
6464
(ci>=0x80 && ci<=0x9f) ||
6565
c == '\\' ||

0 commit comments

Comments
 (0)