fix UTF-16 decoding bug

This commit is contained in:
Martin Michelsen
2023-11-16 21:02:00 -08:00
parent 35f48cbd8f
commit 9cbcd09be0
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -406,7 +406,7 @@ struct pstring {
case TextEncoding::SJIS:
return tt_sjis_to_utf8(this->data, this->used_chars_8());
case TextEncoding::UTF16:
return tt_utf16_to_utf8(this->data, this->used_chars_16());
return tt_utf16_to_utf8(this->data, this->used_chars_16() * 2);
case TextEncoding::UTF8:
return std::string(reinterpret_cast<const char*>(&this->data[0]), this->used_chars_8());
case TextEncoding::CHALLENGE16: {