From: Martin Mares Date: Fri, 17 Jul 2015 14:02:51 +0000 (+0200) Subject: JSON: Less strict checks when formatting strings X-Git-Tag: v6.5~5 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a7c14624d1234799e0c3d71cd0c5acd9de904364;p=libucw.git JSON: Less strict checks when formatting strings Invalid characters are translated to UNI_REPLACEMENT instead of aborting the program. --- 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);