From 3aa9be81d355cb2a128848811fd02112e5af5c5b Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 19 Nov 2023 10:39:12 +0800 Subject: [PATCH] - fix: Use the system default encoding for input when running problem cases. --- NEWS.md | 1 + RedPandaIDE/compiler/ojproblemcasesrunner.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 86316d90..a0cbbe07 100644 --- a/NEWS.md +++ b/NEWS.md @@ -28,6 +28,7 @@ Red Panda C++ Version 2.26 - fix: Crash if include a non-exist header file in the source. - fix: Line numbers for problem case input/output/expected texteditors are not vertically centered. - enhancement: E-ink color scheme. + - fix: Use the system default encoding for input when running problem cases. Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/compiler/ojproblemcasesrunner.cpp b/RedPandaIDE/compiler/ojproblemcasesrunner.cpp index 67b11a7c..3dc7c58e 100644 --- a/RedPandaIDE/compiler/ojproblemcasesrunner.cpp +++ b/RedPandaIDE/compiler/ojproblemcasesrunner.cpp @@ -107,7 +107,7 @@ void OJProblemCasesRunner::runCase(int index,POJProblemCase problemCase) if (fileExists(problemCase->inputFileName)) process.write(readFileToByteArray(problemCase->inputFileName)); else - process.write(problemCase->input.toUtf8()); + process.write(problemCase->input.toLocal8Bit()); process.waitForFinished(0); }