From 23289ffa4c1590aa9b27f01164f0826a5bbf52c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:44:04 +0800 Subject: [PATCH] Update textthread.cpp --- LunaHost/textthread.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/LunaHost/textthread.cpp b/LunaHost/textthread.cpp index 7a2913b..6700f53 100644 --- a/LunaHost/textthread.cpp +++ b/LunaHost/textthread.cpp @@ -56,10 +56,14 @@ void TextThread::Push(BYTE* data, int length) length = 0; } } + auto converted = commonparsestring(data,length,&hp,Host::defaultCodepage); + if(converted) + { + buffer.append(converted.value()); + if (hp.type & FULL_STRING && converted.value().size()>1) buffer.push_back(L'\n'); + } + else Host::AddConsoleOutput(INVALID_CODEPAGE); - if (auto converted = commonparsestring(data,length,&hp,Host::defaultCodepage)) buffer.append(converted.value()); - else Host::AddConsoleOutput(INVALID_CODEPAGE); - if (hp.type & FULL_STRING) buffer.push_back(L'\n'); lastPushTime = GetTickCount64(); if (filterRepetition)