From e557de8d9d785efe974954dfdf0443ea9ebe3fb9 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 21 Jun 2023 02:49:58 +0000 Subject: [PATCH] Fix Unicode handling. --- src/Json.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/Json.c b/src/Json.c index a9f8ce9..15c5577 100644 --- a/src/Json.c +++ b/src/Json.c @@ -376,26 +376,8 @@ JsonEncodeString(const char *str, Stream * out) length += 2; break; default: /* Assume UTF-8 input */ - /* - * RFC 4627: "All Unicode characters may be placed - * within the quotation marks except for the characters - * that must be escaped: quotation mark, reverse solidus, - * and the control characters (U+0000 through U+001F)." - * - * This technically covers the above cases for backspace, - * tab, newline, feed, and carriage return characters, - * but we can save bytes if we encode those as their - * more human-readable representation. - */ - if (c <= 0x001F) - { - length += StreamPrintf(out, "\\u%04x", c); - } - else - { - StreamPutc(out, c); - length++; - } + StreamPutc(out, c); + length++; break; } i++;