mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
string_util: Fix Mingw compile error
Co-Authored-By: liamwhite <9658600+liamwhite@users.noreply.github.com>
This commit is contained in:
parent
51358d2b5e
commit
3c39c0ac3e
1 changed files with 2 additions and 2 deletions
|
@ -141,7 +141,7 @@ static std::wstring CPToUTF16(u32 code_page, const std::string& input) {
|
||||||
MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
|
MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return L"";
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring output(size, L'\0');
|
std::wstring output(size, L'\0');
|
||||||
|
@ -158,7 +158,7 @@ std::string UTF16ToUTF8(const std::wstring& input) {
|
||||||
const auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()),
|
const auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()),
|
||||||
nullptr, 0, nullptr, nullptr);
|
nullptr, 0, nullptr, nullptr);
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return "";
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string output(size, '\0');
|
std::string output(size, '\0');
|
||||||
|
|
Loading…
Reference in a new issue