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.
This commit is contained in:
parent
a4595bb939
commit
bfe84f06f2
@ -285,7 +285,7 @@ private:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode) {
|
void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode) {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
fstream.open(Common::UTF8ToTStr(filename).c_str(), openmode);
|
fstream.open(Common::UTF8ToUTF16W(filename).c_str(), openmode);
|
||||||
#else
|
#else
|
||||||
fstream.open(filename.c_str(), openmode);
|
fstream.open(filename.c_str(), openmode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,24 +76,6 @@ std::u16string UTF8ToUTF16(const std::string& input);
|
|||||||
std::string UTF16ToUTF8(const std::wstring& input);
|
std::string UTF16ToUTF8(const std::wstring& input);
|
||||||
std::wstring UTF8ToUTF16W(const std::string& str);
|
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
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user