Update string_util.cpp

Careless
This commit is contained in:
yami-hack 2016-06-13 16:07:37 +08:00 committed by GitHub
parent 4cd902da5e
commit 1645eee8f4

View File

@ -296,7 +296,7 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
std::string UTF16ToUTF8(const std::u16string& input) std::string UTF16ToUTF8(const std::u16string& input)
{ {
#if _MSC_VER >= 1900 && defined(__MINGW64__) #if _MSC_VER >= 1900 || defined(__MINGW64__)
// Workaround for missing char16_t/char32_t instantiations in MSVC2015 // Workaround for missing char16_t/char32_t instantiations in MSVC2015
std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert; std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert;
std::basic_string<__int16> tmp_buffer(input.cbegin(), input.cend()); std::basic_string<__int16> tmp_buffer(input.cbegin(), input.cend());
@ -309,7 +309,7 @@ std::string UTF16ToUTF8(const std::u16string& input)
std::u16string UTF8ToUTF16(const std::string& input) std::u16string UTF8ToUTF16(const std::string& input)
{ {
#if _MSC_VER >= 1900 && defined(__MINGW64__) #if _MSC_VER >= 1900 || defined(__MINGW64__)
// Workaround for missing char16_t/char32_t instantiations in MSVC2015 // Workaround for missing char16_t/char32_t instantiations in MSVC2015
std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert; std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert;
auto tmp_buffer = convert.from_bytes(input); auto tmp_buffer = convert.from_bytes(input);