Fix bug with UTF16 to UTF8 conversion for chars 0x80..0xFF
This commit is contained in:
parent
c70ed036c9
commit
fdad370c5b
@ -256,12 +256,15 @@ void PREFIX(toUtf8)(const ENCODING *enc, \
|
||||
unsigned char hi = GET_HI(from); \
|
||||
switch (hi) { \
|
||||
case 0: \
|
||||
if (*toP == toLim) { \
|
||||
*fromP = from; \
|
||||
return; \
|
||||
if (lo < 0x80) { \
|
||||
if (*toP == toLim) { \
|
||||
*fromP = from; \
|
||||
return; \
|
||||
} \
|
||||
*(*toP)++ = lo; \
|
||||
break; \
|
||||
} \
|
||||
*(*toP)++ = lo; \
|
||||
break; \
|
||||
/* fall through */ \
|
||||
case 0x1: case 0x2: case 0x3: \
|
||||
case 0x4: case 0x5: case 0x6: case 0x7: \
|
||||
if (toLim - *toP < 2) { \
|
||||
|
Loading…
Reference in New Issue
Block a user