mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-23 03:10:01 +08:00
Fix compile error on OS where char is signed.
This commit is contained in:
parent
508b2ef048
commit
6e22a10eb7
@ -38,14 +38,13 @@ Event Event::Special(const std::string& input) {
|
|||||||
|
|
||||||
void ParseUTF8(Receiver<char>& in, Sender<Event>& out, std::string& input) {
|
void ParseUTF8(Receiver<char>& in, Sender<Event>& out, std::string& input) {
|
||||||
char c;
|
char c;
|
||||||
char mask = 0b11000000;
|
unsigned char head = static_cast<unsigned char>(input[0]);
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i, head <<= 1) {
|
||||||
if ((input[0] & mask) == mask) {
|
if ((head & 0b11000000) != 0b11000000)
|
||||||
if (!in->Receive(&c))
|
break;
|
||||||
return;
|
if (!in->Receive(&c))
|
||||||
input += c;
|
return;
|
||||||
}
|
input += c;
|
||||||
mask = mask >> 1 | 0b10000000;
|
|
||||||
}
|
}
|
||||||
out->Send(Event::Character(input));
|
out->Send(Event::Character(input));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user