Charset parser fix
This commit is contained in:
parent
5b9dcaefd3
commit
c7cc84262a
|
|
@ -171,7 +171,6 @@ bool Charset::load(const char *filename) {
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
unicodeBuffer.clear();
|
unicodeBuffer.clear();
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
state = TIGHT;
|
|
||||||
break;
|
break;
|
||||||
case '"': // string of UTF-8 characters
|
case '"': // string of UTF-8 characters
|
||||||
if (state != CLEAR)
|
if (state != CLEAR)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ void utf8Decode(std::vector<unicode_t> &codepoints, const char *utf8String) {
|
||||||
rBytes = 0;
|
rBytes = 0;
|
||||||
} else if (*c&0x40) {
|
} else if (*c&0x40) {
|
||||||
int block;
|
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) {
|
if (block < 4) {
|
||||||
cp = (*c&(0x3f>>block))<<(6*block);
|
cp = (*c&(0x3f>>block))<<(6*block);
|
||||||
rBytes = block;
|
rBytes = block;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue