From 7806206e90a7244fc6ca12b6e21b5cfb6b8ab921 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:55:43 -0500 Subject: [PATCH] string_util: Remove MSVC workaround for converting between UTF8/UTF16 This has been fixed as of Visual Studio 2019 Version 16.2 --- src/common/string_util.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index f3c64884aa..395cf1d384 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -136,27 +136,13 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st } std::string UTF16ToUTF8(const std::u16string& input) { -#ifdef _MSC_VER - // Workaround for missing char16_t/char32_t instantiations in MSVC2017 - std::wstring_convert, __int16> convert; - std::basic_string<__int16> tmp_buffer(input.cbegin(), input.cend()); - return convert.to_bytes(tmp_buffer); -#else std::wstring_convert, char16_t> convert; return convert.to_bytes(input); -#endif } std::u16string UTF8ToUTF16(const std::string& input) { -#ifdef _MSC_VER - // Workaround for missing char16_t/char32_t instantiations in MSVC2017 - std::wstring_convert, __int16> convert; - auto tmp_buffer = convert.from_bytes(input); - return std::u16string(tmp_buffer.cbegin(), tmp_buffer.cend()); -#else std::wstring_convert, char16_t> convert; return convert.from_bytes(input); -#endif } #ifdef _WIN32