mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-06 10:55:57 +02:00
replace code point in range(0xD800, 0xDFFF) to replacement mark (#714)
closes #712
This commit is contained in:
parent
41ff85f443
commit
63ab03ca28
@ -199,7 +199,7 @@ static unsigned int utf8ToCodepoint(const char*& s, const char* e) {
|
|||||||
s += 2;
|
s += 2;
|
||||||
// surrogates aren't valid codepoints itself
|
// surrogates aren't valid codepoints itself
|
||||||
// shouldn't be UTF-8 encoded
|
// shouldn't be UTF-8 encoded
|
||||||
if (calculated >= 0xD800 && calculated >= 0xDFFF)
|
if (calculated >= 0xD800 && calculated <= 0xDFFF)
|
||||||
return REPLACEMENT_CHARACTER;
|
return REPLACEMENT_CHARACTER;
|
||||||
// oversized encoded characters are invalid
|
// oversized encoded characters are invalid
|
||||||
return calculated < 0x800 ? REPLACEMENT_CHARACTER : calculated;
|
return calculated < 0x800 ? REPLACEMENT_CHARACTER : calculated;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user