Commit 3871d11b authored by Kenton Varda's avatar Kenton Varda

Fix bug in JSON encoder that caused each byte of a UTF-8 sequence to be escaped…

Fix bug in JSON encoder that caused each byte of a UTF-8 sequence to be escaped as a separate character.
parent 21e7b91e
......@@ -120,7 +120,7 @@ struct JsonCodec::Impl {
case '\r': escaped.addAll(kj::StringPtr("\\r")); break;
case '\t': escaped.addAll(kj::StringPtr("\\t")); break;
default:
if (c < 0x20) {
if (c >= 0 && c < 0x20) {
escaped.addAll(kj::StringPtr("\\u00"));
uint8_t c2 = c;
escaped.add(HEXDIGITS[c2 / 16]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment