Charset parser fix

This commit is contained in:
Chlumsky 2020-07-08 17:21:07 +02:00
parent 5b9dcaefd3
commit c7cc84262a
2 changed files with 1 additions and 2 deletions

View File

@ -171,7 +171,6 @@ bool Charset::load(const char *filename) {
goto FAIL;
unicodeBuffer.clear();
buffer.clear();
state = TIGHT;
break;
case '"': // string of UTF-8 characters
if (state != CLEAR)

View File

@ -19,7 +19,7 @@ void utf8Decode(std::vector<unicode_t> &codepoints, const char *utf8String) {
rBytes = 0;
} else if (*c&0x40) {
int block;
for (block = 0; (*c<<block)&0x40 && block < 4; ++block);
for (block = 0; ((unsigned char) *c<<block)&0x40 && block < 4; ++block);
if (block < 4) {
cp = (*c&(0x3f>>block))<<(6*block);
rBytes = block;