json.c: fix utf-16 surrogate pair range - frontends - front-ends for some sites (experiment)
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 3294b8cba72843f441445c1e6608e9d7477453db
(DIR) parent 635193bd5035605177859de58c31c8a69dc29c33
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 22 Jan 2021 00:26:07 +0100
json.c: fix utf-16 surrogate pair range
Synced fix from:
https://git.codemadness.org/json2tsv/commit/b65bd5139faec35430d342dbce6c3b4bf802f4a8.html
Diffstat:
M json.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/json.c b/json.c
@@ -179,8 +179,8 @@ escchr:
cp |= (hexdigit(c) << i);
}
/* RFC8259 - 7. Strings - surrogates.
- * 0xd800 - 0xdb7f - high surrogates */
- if (cp >= 0xd800 && cp <= 0xdb7f) {
+ * 0xd800 - 0xdbff - high surrogates */
+ if (cp >= 0xd800 && cp <= 0xdbff) {
if ((c = GETNEXT()) != '\\') {
len += codepointtoutf8(cp, &str[len]);
goto chr;