From 3054a80906a353b7a7f38152c6070cd9cc397b17 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 21 Jun 2023 02:49:58 +0000 Subject: [PATCH] Fix Unicode handling. --- Cytoplasm/src/Json.c | 22 ++-------------------- TODO.txt | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/Cytoplasm/src/Json.c b/Cytoplasm/src/Json.c index a9f8ce9..15c5577 100644 --- a/Cytoplasm/src/Json.c +++ b/Cytoplasm/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++; diff --git a/TODO.txt b/TODO.txt index dc32831..b3357c5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -45,7 +45,7 @@ Milestone: v0.4.0 use the default. This will make debugging a lot easier. [ ] Make sure admin registration token is printed to log, not stdout. Unless they are the same, of course. -[ ] Fix Json UTF-8 handling. +[x] Fix Json UTF-8 handling. Milestone: v0.5.0 -----------------