mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Two bugs in Encoding
This commit is contained in:
1 parent
a47edbf6ef
commit
0323598941
2 files changed
+4
-3
No files matched your search
@@ -110,8 +110,9 @@ struct ShiftJIS {
|
||||
} else if (row < 0x5F) {
|
||||
// Reduce by 0x40 to account for the above range.
|
||||
*dest++ = 0xE0 + ((row - 0x40 + 1) >> 1);
|
||||
} else if (row >= 0x80) {
|
||||
// TODO
|
||||
} else {
|
||||
// Rows 0x5F-0x7F and 0x80+ are not encodable.
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (row & 1) {
|
||||
|
||||
@@ -207,7 +207,7 @@ void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, std::string_view sourc
|
||||
destSize -= 1; // account for the \0.
|
||||
int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.data(), len, NULL, 0);
|
||||
MultiByteToWideChar(CP_UTF8, 0, source.data(), len, dest, std::min((int)destSize, size));
|
||||
dest[size] = 0;
|
||||
dest[std::min(size, (int)destSize)] = 0;
|
||||
}
|
||||
|
||||
std::wstring ConvertUTF8ToWString(const std::string_view source) {
|
||||
|
||||
Reference in new issue
Block a user