Skip to content
Snippets Groups Projects
Commit 0cdaae1a authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

Merge branch 'wip/sr385-non-codepoints' into 'master'

inspect-library: Don't print non-ASCII as nonsense codepoints

See merge request !278
parents 98b91310 869b7c0d
No related branches found
No related tags found
1 merge request!278inspect-library: Don't print non-ASCII as nonsense codepoints
Pipeline #10581 passed
...@@ -485,11 +485,11 @@ main (int argc, ...@@ -485,11 +485,11 @@ main (int argc,
static void static void
print_json_string_content (const char *s) print_json_string_content (const char *s)
{ {
const char *p; const unsigned char *p;
for (p = s; *p != '\0'; p++) for (p = (const unsigned char *) s; *p != '\0'; p++)
{ {
if (*p == '"' || *p == '\\' || *p <= 0x1F) if (*p == '"' || *p == '\\' || *p <= 0x1F || *p >= 0x80)
printf ("\\u%04x", *p); printf ("\\u%04x", *p);
else else
printf ("%c", *p); printf ("%c", *p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment