diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/string_util.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index b3b772bd9..3264dd51a 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -426,7 +426,7 @@ std::u16string UTF8ToUTF16(const std::string& input) | |||
| 426 | 426 | ||
| 427 | static std::string UTF16ToUTF8(const std::wstring& input) | 427 | static std::string UTF16ToUTF8(const std::wstring& input) |
| 428 | { | 428 | { |
| 429 | auto const size = WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), nullptr, 0, nullptr, nullptr); | 429 | auto const size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()), nullptr, 0, nullptr, nullptr); |
| 430 | 430 | ||
| 431 | std::string output; | 431 | std::string output; |
| 432 | output.resize(size); | 432 | output.resize(size); |
| @@ -439,12 +439,12 @@ static std::string UTF16ToUTF8(const std::wstring& input) | |||
| 439 | 439 | ||
| 440 | static std::wstring CPToUTF16(u32 code_page, const std::string& input) | 440 | static std::wstring CPToUTF16(u32 code_page, const std::string& input) |
| 441 | { | 441 | { |
| 442 | auto const size = MultiByteToWideChar(code_page, 0, input.data(), input.size(), nullptr, 0); | 442 | auto const size = MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0); |
| 443 | 443 | ||
| 444 | std::wstring output; | 444 | std::wstring output; |
| 445 | output.resize(size); | 445 | output.resize(size); |
| 446 | 446 | ||
| 447 | if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), input.size(), &output[0], output.size())) | 447 | if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), &output[0], static_cast<int>(output.size()))) |
| 448 | output.clear(); | 448 | output.clear(); |
| 449 | 449 | ||
| 450 | return output; | 450 | return output; |