Replace local 8-bit decoding with UTF-8 decoding

Handles incomplete byte sequences using `QTextDecoder`

Signed-off-by: Mitchell Skaggs <skaggsm333@gmail.com>
This commit is contained in:
Mitchell Skaggs
2022-08-08 23:54:01 -05:00
parent 0e473f4570
commit a14476c5fb
2 changed files with 10 additions and 23 deletions

View File

@@ -36,6 +36,7 @@
#pragma once
#include <QProcess>
#include <QTextDecoder>
#include "MessageLevel.h"
/*
@@ -88,8 +89,8 @@ private:
void changeState(LoggedProcess::State state);
private:
QString m_err_leftover;
QString m_out_leftover;
QTextDecoder m_err_decoder = QTextDecoder(QTextCodec::codecForName("UTF-8"));
QTextDecoder m_out_decoder = QTextDecoder(QTextCodec::codecForName("UTF-8"));
bool m_killed = false;
State m_state = NotRunning;
int m_exit_code = 0;