commit 158bc12

default  ·  2023-03-08 02:55:10 +0000 UTC
parent b0f39a8
Show Unicode symbols for replaced control codes.
1 files changed,  +2, -2
+2, -2
 1@@ -260,9 +260,9 @@ static xs_val *_xs_json_loads_lexer(const char **json, js_type *t)
 2                     else
 3                         cp = i;
 4 
 5-                    /* replace dangerous control codes with the replacement char */
 6+                    /* replace dangerous control codes with their visual representations */
 7                     if (cp >= '\0' && cp < ' ' && !strchr("\r\n\t", cp))
 8-                        cp = 0xfffd;
 9+                        cp += 0x2400;
10 
11                     v = xs_utf8_enc(v, cp);
12                     c = '\0';