mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 11:40:14 +00:00
Update string_util.cpp
This commit is contained in:
parent
75e5f5287e
commit
47eb86cf92
@ -323,11 +323,13 @@ std::u16string UTF8ToUTF16(const std::string& input)
|
|||||||
static std::wstring CPToUTF16(u32 code_page, const std::string& input)
|
static std::wstring CPToUTF16(u32 code_page, const std::string& input)
|
||||||
{
|
{
|
||||||
auto const size = MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
|
auto const size = MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
|
||||||
std::wstring output;
|
|
||||||
|
std::wstring output;
|
||||||
output.resize(size);
|
output.resize(size);
|
||||||
|
|
||||||
if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), &output[0], static_cast<int>(output.size())))
|
if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), &output[0], static_cast<int>(output.size())))
|
||||||
output.clear();
|
output.clear();
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user