Merge pull request #3385 from jepler/fix-unicode-above-2047
Fix decompression of unicode values above 2047
This commit is contained in:
commit
715b8d55cc
@ -51,8 +51,8 @@ STATIC int put_utf8(char *buf, int u) {
|
|||||||
*buf = 0b10000000 | (u & 0b00111111);
|
*buf = 0b10000000 | (u & 0b00111111);
|
||||||
return 2;
|
return 2;
|
||||||
} else { // u <= 0xffff)
|
} else { // u <= 0xffff)
|
||||||
*buf++ = 0b11000000 | (u >> 12);
|
*buf++ = 0b11100000 | (u >> 12);
|
||||||
*buf = 0b10000000 | ((u >> 6) & 0b00111111);
|
*buf++ = 0b10000000 | ((u >> 6) & 0b00111111);
|
||||||
*buf = 0b10000000 | (u & 0b00111111);
|
*buf = 0b10000000 | (u & 0b00111111);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user