dump \u sequences as upper case for readability (just like error messages)

This commit is contained in:
Chip Salzenberg 2013-09-26 22:25:48 -07:00
parent 9c259c07aa
commit dcaa90d21e
2 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ static int dump_string(const char *str, size_t len, json_dump_callback_t dump, v
/* codepoint is in BMP */
if(codepoint < 0x10000)
{
sprintf(seq, "\\u%04x", codepoint);
sprintf(seq, "\\u%04X", codepoint);
length = 6;
}
@ -140,7 +140,7 @@ static int dump_string(const char *str, size_t len, json_dump_callback_t dump, v
first = 0xD800 | ((codepoint & 0xffc00) >> 10);
last = 0xDC00 | (codepoint & 0x003ff);
sprintf(seq, "\\u%04x\\u%04x", first, last);
sprintf(seq, "\\u%04X\\u%04X", first, last);
length = 12;
}

View File

@ -1 +1 @@
["foo", "\u00e5 \u00e4 \u00f6", "foo \u00e5\u00e4", "\u00e5\u00e4 foo", "\u00e5 foo \u00e4", "clef g: \ud834\udd1e"]
["foo", "\u00E5 \u00E4 \u00F6", "foo \u00E5\u00E4", "\u00E5\u00E4 foo", "\u00E5 foo \u00E4", "clef g: \uD834\uDD1E"]