Use std::u16string for conversion between UTF-8 and UTF-16, FS:USER functions
This commit is contained in:
parent
0ad5964c8b
commit
1f7c4ab7f6
5 changed files with 257 additions and 192 deletions
|
@ -89,20 +89,22 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
|
|||
std::string UriDecode(const std::string & sSrc);
|
||||
std::string UriEncode(const std::string & sSrc);
|
||||
|
||||
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);
|
||||
std::string UTF16ToUTF8(const std::wstring& str);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
std::wstring UTF8ToUTF16(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 UTF8ToUTF16(str); }
|
||||
{ return UTF8ToUTF16W(str); }
|
||||
#else
|
||||
inline std::string TStrToUTF8(const std::string& str)
|
||||
{ return str; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue