Use UTF-8 to decode logs on Java 18 or newer

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2024-10-09 16:59:56 +01:00
parent 909114bf2a
commit 98adcc60a3
5 changed files with 15 additions and 6 deletions

View File

@ -48,7 +48,9 @@
#include "gamemode_client.h"
#endif
LauncherPartLaunch::LauncherPartLaunch(LaunchTask* parent) : LaunchStep(parent)
LauncherPartLaunch::LauncherPartLaunch(LaunchTask* parent)
: LaunchStep(parent)
, m_process(parent->instance()->getJavaVersion().defaultsToUtf8() ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale())
{
if (parent->instance()->settings()->get("CloseAfterLaunch").toBool()) {
std::shared_ptr<QMetaObject::Connection> connection{ new QMetaObject::Connection };