Bugfix to fill_utf8() to make it actually work right
This commit is contained in:
parent
9884031625
commit
516a1766a5
|
@ -301,8 +301,9 @@ static void fill_utf8(termkey_key *key)
|
||||||
|
|
||||||
// This is easier done backwards
|
// This is easier done backwards
|
||||||
int b = nbytes;
|
int b = nbytes;
|
||||||
while(b-- > 0) {
|
while(b > 1) {
|
||||||
key->utf8[b] = codepoint & 0x3f;
|
b--;
|
||||||
|
key->utf8[b] = 0x80 | (codepoint & 0x3f);
|
||||||
codepoint >>= 6;
|
codepoint >>= 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue