diff options
Diffstat (limited to 'src/common/string_util.cpp')
| -rw-r--r-- | src/common/string_util.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 7dc0ba7ba..b2f7f7b1d 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -2,9 +2,13 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <boost/range/algorithm.hpp> | 5 | #include <cctype> |
| 6 | #include <cerrno> | ||
| 7 | #include <cstdio> | ||
| 8 | #include <cstdlib> | ||
| 9 | #include <cstring> | ||
| 10 | #include <boost/range/algorithm/transform.hpp> | ||
| 6 | 11 | ||
| 7 | #include "common/common_funcs.h" | ||
| 8 | #include "common/common_paths.h" | 12 | #include "common/common_paths.h" |
| 9 | #include "common/logging/log.h" | 13 | #include "common/logging/log.h" |
| 10 | #include "common/string_util.h" | 14 | #include "common/string_util.h" |
| @@ -12,6 +16,7 @@ | |||
| 12 | #ifdef _MSC_VER | 16 | #ifdef _MSC_VER |
| 13 | #include <Windows.h> | 17 | #include <Windows.h> |
| 14 | #include <codecvt> | 18 | #include <codecvt> |
| 19 | #include "common/common_funcs.h" | ||
| 15 | #else | 20 | #else |
| 16 | #include <iconv.h> | 21 | #include <iconv.h> |
| 17 | #endif | 22 | #endif |
| @@ -308,7 +313,7 @@ static std::string UTF16ToUTF8(const std::wstring& input) | |||
| 308 | std::string output; | 313 | std::string output; |
| 309 | output.resize(size); | 314 | output.resize(size); |
| 310 | 315 | ||
| 311 | if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), &output[0], output.size(), nullptr, nullptr)) | 316 | if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()), &output[0], static_cast<int>(output.size()), nullptr, nullptr)) |
| 312 | output.clear(); | 317 | output.clear(); |
| 313 | 318 | ||
| 314 | return output; | 319 | return output; |