aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2013-09-26 22:25:48 -0700
committerChip Salzenberg <chip@pobox.com>2013-09-27 17:32:25 -0700
commitdcaa90d21e9405973accbcb9f94d85f222444d7b (patch)
tree161c09ded9b85144efd88d148b5d904fceb6ea49
parent9c259c07aa53381df5819ef61627342c932d626f (diff)
downloadjansson-dcaa90d21e9405973accbcb9f94d85f222444d7b.zip
jansson-dcaa90d21e9405973accbcb9f94d85f222444d7b.tar.gz
jansson-dcaa90d21e9405973accbcb9f94d85f222444d7b.tar.bz2
dump \u sequences as upper case for readability (just like error messages)
-rw-r--r--src/dump.c4
-rw-r--r--test/suites/encoding-flags/ensure-ascii/output2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dump.c b/src/dump.c
index 3589de1..d347aae 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -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;
}
diff --git a/test/suites/encoding-flags/ensure-ascii/output b/test/suites/encoding-flags/ensure-ascii/output
index 36f8eb5..94fa79d 100644
--- a/test/suites/encoding-flags/ensure-ascii/output
+++ b/test/suites/encoding-flags/ensure-ascii/output
@@ -1 +1 @@
-["foo", "\u00e5 \u00e4 \u00f6", "foo \u00e5\u00e4", "\u00e5\u00e4 foo", "\u00e5 foo \u00e4", "clef g: \ud834\udd1e"] \ No newline at end of file
+["foo", "\u00E5 \u00E4 \u00F6", "foo \u00E5\u00E4", "\u00E5\u00E4 foo", "\u00E5 foo \u00E4", "clef g: \uD834\uDD1E"] \ No newline at end of file