summaryrefslogtreecommitdiff
path: root/xs_json.h
diff options
context:
space:
mode:
authorGravatar default2023-03-08 03:55:10 +0100
committerGravatar default2023-03-08 03:55:10 +0100
commit158bc127a35ef48e8a3c1dc510aababb8abdb676 (patch)
treeede71418b29dddd46be2559d12948026a8b2926e /xs_json.h
parentUpdated RELEASE_NOTES. (diff)
downloadpenes-snac2-158bc127a35ef48e8a3c1dc510aababb8abdb676.tar.gz
penes-snac2-158bc127a35ef48e8a3c1dc510aababb8abdb676.tar.xz
penes-snac2-158bc127a35ef48e8a3c1dc510aababb8abdb676.zip
Show Unicode symbols for replaced control codes.
Diffstat (limited to 'xs_json.h')
-rw-r--r--xs_json.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs_json.h b/xs_json.h
index 36a0665..c171172 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -260,9 +260,9 @@ static xs_val *_xs_json_loads_lexer(const char **json, js_type *t)
260 else 260 else
261 cp = i; 261 cp = i;
262 262
263 /* replace dangerous control codes with the replacement char */ 263 /* replace dangerous control codes with their visual representations */
264 if (cp >= '\0' && cp < ' ' && !strchr("\r\n\t", cp)) 264 if (cp >= '\0' && cp < ' ' && !strchr("\r\n\t", cp))
265 cp = 0xfffd; 265 cp += 0x2400;
266 266
267 v = xs_utf8_enc(v, cp); 267 v = xs_utf8_enc(v, cp);
268 c = '\0'; 268 c = '\0';