From 99f1ac1cc5f024daf423835f1e682856bfefd7d7 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 31 Dec 2020 00:50:39 +0100 Subject: [PATCH] Fix logging process output on Windows --- Source/Engine/Platform/Windows/WindowsPlatform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp index c1eae68aa..8a614ebf5 100644 --- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp +++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp @@ -1013,8 +1013,8 @@ int32 WindowsPlatform::RunProcess(const StringView& cmdLine, const StringView& w outData.RemoveAllKeepOrder('\r'); Array buffer; buffer.Resize(outData.Count() + 1); - uint32 length = 0; - StringUtils::ConvertUTF82UTF16(outData.Get(), buffer.Get(), outData.Count(), &length); + const uint32 length = outData.Count(); + StringUtils::ConvertANSI2UTF16(outData.Get(), buffer.Get(), outData.Count()); buffer[length] = '\0'; Log::Logger::Write(LogType::Info, StringView(buffer.Get(), length)); } @@ -1024,8 +1024,8 @@ int32 WindowsPlatform::RunProcess(const StringView& cmdLine, const StringView& w errData.RemoveAllKeepOrder('\r'); Array buffer; buffer.Resize(errData.Count() + 1); - uint32 length = 0; - StringUtils::ConvertUTF82UTF16(errData.Get(), buffer.Get(), errData.Count(), &length); + const uint32 length = errData.Count(); + StringUtils::ConvertANSI2UTF16(errData.Get(), buffer.Get(), errData.Count()); buffer[length] = '\0'; Log::Logger::Write(LogType::Error, StringView(buffer.Get(), length)); }