fix utf-8 encoding with 4 byte long codes

This commit is contained in:
Kiss-Vamosi Gabor
2018-01-21 12:43:47 +01:00
parent 46a1a8dfde
commit cb1bbeaf3a

View File

@@ -415,7 +415,7 @@ uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i)
(*i)++;
if((txt[*i] & 0xC0) != 0x80) return 0; /*Invalid UTF-8 code*/
result += (uint32_t)(txt[*i] & 0x3F) << 6;
result += txt[*i] & 0x3F;
(*i)++;
} else {
(*i)++; /*Not UTF-8 char. Go the next.*/