mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-08 01:00:11 +00:00
Fix case where UTF16stoUTF8s in cellL10n.cpp would always fail out if compiled with Visual Studio.
This commit is contained in:
parent
4db1f49aaf
commit
8302e6c001
1 changed files with 9 additions and 7 deletions
|
@ -23,13 +23,13 @@ enum
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
L10N_STR_UNKNOWN = (1 << 0),
|
L10N_STR_UNKNOWN = (1 << 0),
|
||||||
L10N_STR_ASCII = (1 << 1),
|
L10N_STR_ASCII = (1 << 1),
|
||||||
L10N_STR_JIS = (1 << 2),
|
L10N_STR_JIS = (1 << 2),
|
||||||
L10N_STR_EUCJP = (1 << 3),
|
L10N_STR_EUCJP = (1 << 3),
|
||||||
L10N_STR_SJIS = (1 << 4),
|
L10N_STR_SJIS = (1 << 4),
|
||||||
L10N_STR_UTF8 = (1 << 5),
|
L10N_STR_UTF8 = (1 << 5),
|
||||||
L10N_STR_ILLEGAL = (1 << 16),
|
L10N_STR_ILLEGAL = (1 << 16),
|
||||||
L10N_STR_ERROR = (1 << 17),
|
L10N_STR_ERROR = (1 << 17),
|
||||||
};
|
};
|
||||||
|
|
||||||
int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t utf8_len)
|
int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t utf8_len)
|
||||||
|
@ -47,8 +47,10 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
|
||||||
std::string str = convert.to_bytes(wstr);
|
std::string str = convert.to_bytes(wstr);
|
||||||
|
|
||||||
if (!utf8.IsGood() || utf8_len.GetValue() < str.size())
|
if (!utf8.IsGood() || utf8_len.GetValue() < str.size())
|
||||||
|
{
|
||||||
utf8_len = str.size();
|
utf8_len = str.size();
|
||||||
return DSTExhausted;
|
return DSTExhausted;
|
||||||
|
}
|
||||||
|
|
||||||
utf8_len = str.size();
|
utf8_len = str.size();
|
||||||
Memory.WriteString(utf8, str.c_str());
|
Memory.WriteString(utf8, str.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue