Correct UTF-8 encoding of U+FFFF

Overlong (and hence invalid) 4-byte encoding was used for this character
instead of the correct 3-byte 0xEF 0xBF 0xBF sequence.

Fix this by using 3 bytes for the code points up to 0xFFFF included,
instead of excluding it as was done before.

Closes #17920.
This commit is contained in:
Vadim Zeitlin
2018-01-28 17:50:51 +01:00
parent 26997607b6
commit 5bc208df3c
4 changed files with 17 additions and 2 deletions

View File

@@ -431,7 +431,7 @@ wxScopedCharBuffer wxUString::utf8_str() const
{
utf8_length += 2;
}
else if ( code < 0xFFFF )
else if ( code <= 0xFFFF )
{
utf8_length += 3;
}