mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 04:04:59 -07:00
fix utf8 encoding missing one bit shift
For Unicode code point in the highest range, 1 bit shift operation on the 4th byte is missing, giving a wrong encoding
This commit is contained in:
committed by
Ryan Fleury
parent
2c73c65878
commit
fb9e890653
@@ -1306,7 +1306,7 @@ utf8_encode(U8 *str, U32 codepoint){
|
||||
inc = 3;
|
||||
}
|
||||
else if (codepoint <= 0x10FFFF){
|
||||
str[0] = (bitmask4 << 3) | ((codepoint >> 18) & bitmask3);
|
||||
str[0] = (bitmask4 << 4) | ((codepoint >> 18) & bitmask3);
|
||||
str[1] = bit8 | ((codepoint >> 12) & bitmask6);
|
||||
str[2] = bit8 | ((codepoint >> 6) & bitmask6);
|
||||
str[3] = bit8 | ( codepoint & bitmask6);
|
||||
|
||||
Reference in New Issue
Block a user