From a7c14624d1234799e0c3d71cd0c5acd9de904364 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 17 Jul 2015 16:02:51 +0200 Subject: [PATCH] JSON: Less strict checks when formatting strings Invalid characters are translated to UNI_REPLACEMENT instead of aborting the program. --- ucw-json/format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucw-json/format.c b/ucw-json/format.c index 8549f2ba..227a26b5 100644 --- a/ucw-json/format.c +++ b/ucw-json/format.c @@ -57,7 +57,7 @@ static void write_string(struct json_context *js, const char *p) else if (u < 0x110000) bprintf(fb, "\\u%04x\\u%04x", 0xd800 + ((u - 0x10000) >> 10), 0xdc00 + (u & 0x3ff)); else - ASSERT(0); + bprintf(fb, "\\u%04x", UNI_REPLACEMENT); } else bput_utf8_32(fb, u); -- 2.39.2