on master help sign in
Fixed "Invalid UTF-8 stream" error on valid characters (#476).
commit8049b358ee9624988bcf87c768ede10fed324db5 authorVladimir Shabanov <vshabanoff@gmail.com> dateFri 21 Oct 2016, 01:54 (10 years ago) parentd9f0374
1 file changed+1−2
cbits/unescape_string.c+1−2
cbits/unescape_string.c+1−2
@@ -130,7 +130,7 @@ int _js_decode_string(uint16_t *const dest, size_t *destoff,
130130 *d++ = (uint16_t) unidata;
131131
132132 if (surrogate) {
133− if (unidata <= 0xDC00 || unidata >= 0xDFFF) // is not low surrogate
133+ if (unidata < 0xDC00 || unidata > 0xDFFF) // is not low surrogate
134134 return -1;
135135 surrogate = 0;
136136 } else if (unidata >= 0xD800 && unidata <= 0xDBFF ) { // is high surrogate
@@ -147,4 +147,3 @@ int _js_decode_string(uint16_t *const dest, size_t *destoff,
147147 if (codepoint != 'u') { return -1; }
148148 DISPATCH_ASCII(unicode1)
149149}
150−