From a4595bb93947c849c8101cac6de29f9f694f26b1 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Sat, 22 Sep 2018 00:45:50 -0400 Subject: string_util: remove ShiftJIS/CP1252 conversion function We always use unicode internally. Any dirty work of conversion with other codec should be handled by frontend framework (Qt). Further more, ShiftJIS/CP1252 are not special (they are not code set used by 3ds, or any guest/host dependencies we have), so there is no reason to specifically include them --- src/common/string_util.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/common/string_util.h') diff --git a/src/common/string_util.h b/src/common/string_util.h index dcca6bc38..78b558405 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -72,9 +72,6 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st std::string UTF16ToUTF8(const std::u16string& input); std::u16string UTF8ToUTF16(const std::string& input); -std::string CP1252ToUTF8(const std::string& str); -std::string SHIFTJISToUTF8(const std::string& str); - #ifdef _WIN32 std::string UTF16ToUTF8(const std::wstring& input); std::wstring UTF8ToUTF16W(const std::string& str); -- cgit v1.2.3 From bfe84f06f2de966b68026f5b3f4212fd2ba783b6 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Sat, 22 Sep 2018 00:52:38 -0400 Subject: string_util: remove TString conversion for windows First of all they are foundamentally broken. As our convention is that std::string is always UTF-8, these functions assume that the multi-byte character version of TString (std::string) from windows is also in UTF-8, which is almost always wrong. We are not going to build multi-byte character build, and even if we do, this dirty work should be handled by frontend framework early. --- src/common/string_util.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/common/string_util.h') diff --git a/src/common/string_util.h b/src/common/string_util.h index 78b558405..32bf6a19c 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -76,24 +76,6 @@ std::u16string UTF8ToUTF16(const std::string& input); std::string UTF16ToUTF8(const std::wstring& input); std::wstring UTF8ToUTF16W(const std::string& str); -#ifdef _UNICODE -inline std::string TStrToUTF8(const std::wstring& str) { - return UTF16ToUTF8(str); -} - -inline std::wstring UTF8ToTStr(const std::string& str) { - return UTF8ToUTF16W(str); -} -#else -inline std::string TStrToUTF8(const std::string& str) { - return str; -} - -inline std::string UTF8ToTStr(const std::string& str) { - return str; -} -#endif - #endif /** -- cgit v1.2.3