commit ec2c5c2

grunfink  ·  2026-06-25 16:36:11 +0000 UTC
parent 04daf69
Fixed JSON parser to correctly convert u0000 to the Unicode representation.
1 files changed,  +1, -1
+1, -1
1@@ -281,7 +281,7 @@ static xs_val *_xs_json_load_lexer(FILE *f, js_type *t)
2                     }
3 
4                     /* replace dangerous control codes with their visual representations */
5-                    if (cp < ' ' && !strchr("\r\n\t", cp))
6+                    if (cp == 0 || (cp < ' ' && !strchr("\r\n\t", cp)))
7                         cp += 0x2400;
8 
9                     break;