Skip to content

Commit 63ab03c

Browse files
authored
replace code point in range(0xD800, 0xDFFF) to replacement mark (#714)
closes #712
1 parent 41ff85f commit 63ab03c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib_json/json_writer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static unsigned int utf8ToCodepoint(const char*& s, const char* e) {
199199
s += 2;
200200
// surrogates aren't valid codepoints itself
201201
// shouldn't be UTF-8 encoded
202-
if (calculated >= 0xD800 && calculated >= 0xDFFF)
202+
if (calculated >= 0xD800 && calculated <= 0xDFFF)
203203
return REPLACEMENT_CHARACTER;
204204
// oversized encoded characters are invalid
205205
return calculated < 0x800 ? REPLACEMENT_CHARACTER : calculated;

0 commit comments

Comments
 (0)