mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common: Rename UTF16ToUTF8
This function does *not* always convert from UTF-16. It converts from UTF-16 on Windows and UTF-32 on other operating systems. Also renaming UTF8ToUTF16 for consistency, even though it technically doesn't have the same problem since it only was implemented on Windows.
This commit is contained in:
@ -171,22 +171,22 @@ void StringPopBackIf(std::string* s, char c);
|
||||
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
|
||||
|
||||
#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)
|
||||
@ -220,7 +220,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
|
||||
|
Reference in New Issue
Block a user