From ac9d62ee5ed6c599ac1436d0d5552af22994eaa7 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 9 Mar 2023 16:09:05 +0800 Subject: [PATCH] - fix: Chinese characters in the source code is not correctly displayed in the CPU info window. --- NEWS.md | 1 + RedPandaIDE/debugger.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 30c59957..6b7e34a5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,7 @@ Red Panda C++ Version 2.17 - enhancement: Shift+Up in the first line will expand selection to the beginning of the line. - enhancement: Shift+Down in the last line will expand selection to the end of the line. - enhancement: If no selection, Ctrl+C (Copy) auto selects the current line and put the cursor to the beginning. + - fix: Chinese characters in the source code is not correctly displayed in the CPU info window. Red Panda C++ Version 2.16 diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index afed0b89..21c83965 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -1082,7 +1082,8 @@ void DebugReader::processConsoleOutput(const QByteArray& line) p++; } } - mConsoleOutput.append(QString::fromLocal8Bit(stringValue)); + //mConsoleOutput.append(QString::fromLocal8Bit(stringValue)); + mConsoleOutput.append(QString::fromUtf8(stringValue)); } } @@ -1242,7 +1243,7 @@ void DebugReader::processResultRecord(const QByteArray &line) processResult(result); } else if (mCurrentCmd && !(mCurrentCmd->command.startsWith('-'))) { if (mCurrentCmd->command == "disas") { - QStringList disOutput = mConsoleOutput; + QStringList disOutput = mConsoleOutput; if (disOutput.length()>=3) { disOutput.pop_back(); disOutput.pop_front();