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

@@ -1135,7 +1135,7 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen,
out[0] = 0xC0 | code;
}
}
else if ( code < 0xFFFF )
else if ( code <= 0xFFFF )
{
len = 3;
if ( out )