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); \
|
unsigned char hi = GET_HI(from); \
|
||||||
switch (hi) { \
|
switch (hi) { \
|
||||||
case 0: \
|
case 0: \
|
||||||
|
if (lo < 0x80) { \
|
||||||
if (*toP == toLim) { \
|
if (*toP == toLim) { \
|
||||||
*fromP = from; \
|
*fromP = from; \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
*(*toP)++ = lo; \
|
*(*toP)++ = lo; \
|
||||||
break; \
|
break; \
|
||||||
|
} \
|
||||||
|
/* fall through */ \
|
||||||
case 0x1: case 0x2: case 0x3: \
|
case 0x1: case 0x2: case 0x3: \
|
||||||
case 0x4: case 0x5: case 0x6: case 0x7: \
|
case 0x4: case 0x5: case 0x6: case 0x7: \
|
||||||
if (toLim - *toP < 2) { \
|
if (toLim - *toP < 2) { \
|
||||||
|
Loading…
Reference in New Issue
Block a user