Open sean2077 opened 11 months ago
In unicode::details::utf8_decode function:
static inline std::wstring utf8_decode(const std::string& s) { std::string curLocale = setlocale(LC_ALL, ""); const char* _Source = s.c_str(); size_t _Dsize = mbstowcs(NULL, _Source, 0) + 1; wchar_t* _Dest = new wchar_t[_Dsize]; wmemset(_Dest, 0, _Dsize); mbstowcs(_Dest, _Source, _Dsize); std::wstring result = _Dest; delete[] _Dest; setlocale(LC_ALL, curLocale.c_str()); return result; }
std::string curLocale = setlocale(LC_ALL, ""); will throw std::logic_error when setlocale(LC_ALL, "") return NULL
In unicode::details::utf8_decode function:
std::string curLocale = setlocale(LC_ALL, ""); will throw std::logic_error when setlocale(LC_ALL, "") return NULL