Fix bug in utf8_encoding with surrogates
This commit is contained in:
parent
12693c93ca
commit
2ec75e44bc
@ -117,7 +117,7 @@ int utf8_encode(const ENCODING *enc, int c, char *buf)
|
|||||||
buf[1] = (((c >> 12) & 0x3f) | 0x80);
|
buf[1] = (((c >> 12) & 0x3f) | 0x80);
|
||||||
buf[2] = (((c >> 6) & 0x3f) | 0x80);
|
buf[2] = (((c >> 6) & 0x3f) | 0x80);
|
||||||
buf[3] = ((c & 0x3f) | 0x80);
|
buf[3] = ((c & 0x3f) | 0x80);
|
||||||
return 3;
|
return 4;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user