summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.h
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-07-18 22:13:14 -0400
committerGitHub <noreply@github.com>2020-07-18 22:13:14 -0400
commit487cd7abd9f13da2969a992b78b08e65f9e20d9f (patch)
tree8477a16c66f16f5b5f25a40c1c730fa4e6544524 /Source/Core/Common/StringUtil.h
parent5c2b6d06267df15b352ad75862575a2c83bf0ffb (diff)
parentf5da6e07d7405d89cc550b8c02f39a432f7888a3 (diff)
Merge pull request #8905 from JosJuice/jni-encoding
Android: Use correct encoding when converting strings
Diffstat (limited to 'Source/Core/Common/StringUtil.h')
-rw-r--r--Source/Core/Common/StringUtil.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index 4a97d2487b..0539667383 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -172,22 +172,24 @@ size_t StringUTF8CodePointCount(const std::string& str);
std::string CP1252ToUTF8(std::string_view str);
std::string SHIFTJISToUTF8(std::string_view str);
std::string UTF8ToSHIFTJIS(std::string_view str);
-std::string UTF16ToUTF8(std::wstring_view str);
+std::string WStringToUTF8(std::wstring_view str);
std::string UTF16BEToUTF8(const char16_t* str, size_t max_size); // Stops at \0
+std::string UTF16ToUTF8(std::u16string_view str);
+std::u16string UTF8ToUTF16(std::string_view str);
#ifdef _WIN32
-std::wstring UTF8ToUTF16(std::string_view str);
+std::wstring UTF8ToWString(std::string_view str);
#ifdef _UNICODE
inline std::string TStrToUTF8(std::wstring_view str)
{
- return UTF16ToUTF8(str);
+ return WStringToUTF8(str);
}
inline std::wstring UTF8ToTStr(std::string_view str)
{
- return UTF8ToUTF16(str);
+ return UTF8ToWString(str);
}
#else
inline std::string TStrToUTF8(std::string_view str)
@@ -221,7 +223,7 @@ std::string ThousandSeparate(I value, int spaces = 0)
stream << std::setw(spaces) << value;
#ifdef _WIN32
- return UTF16ToUTF8(stream.str());
+ return WStringToUTF8(stream.str());
#else
return stream.str();
#endif