From 65c1df094f90c8fbc3114b70ea012a494ddafdc1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 11 Nov 2017 14:07:28 +0100 Subject: [PATCH] Remove unneeded check in StringUtil::UTF16ToUTF8 No code is relying on this unexplained null byte check, since the only code that calls UTF16ToUTF8 on non-Windows systems is UTF16BEToUTF8, which explicitly strips null bytes. --- Source/Core/Common/StringUtil.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index c904f150da..d4aefefc59 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -569,11 +569,7 @@ std::string UTF8ToSHIFTJIS(const std::string& input) std::string UTF16ToUTF8(const std::wstring& input) { - std::string result = CodeToUTF8("UTF-16LE", input); - - // TODO: why is this needed? - result.erase(std::remove(result.begin(), result.end(), 0x00), result.end()); - return result; + return CodeToUTF8("UTF-16LE", input); } #endif