aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-10-07 23:24:56 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-10-07 23:24:56 -0400
commitbda14d28d2763ba84c78800022d2f06e4677d3e2 (patch)
tree1791a930e1f644ddaa305a12ada571e5c028f4c5
parent350b0dd1780f93e15fd86ebf8b38f96e3987edb3 (diff)
downloaddeduper-bda14d28d2763ba84c78800022d2f06e4677d3e2.tar.xz
Force UTF-8 codec on qt < 6.0. Patch by @BLumia.
-rw-r--r--qdeduper/mingui.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp
index dcda53a..670b128 100644
--- a/qdeduper/mingui.cpp
+++ b/qdeduper/mingui.cpp
@@ -656,6 +656,9 @@ void DeduperMainWindow::save_list()
QFile file(fn);
if (!file.open(QIODevice::WriteOnly)) return;
QTextStream fst(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ fst.setCodec("UTF-8");
+#endif
for (const fs::path &x : this->marked)
{
#if PATH_VALSIZE == 2
@@ -675,6 +678,9 @@ void DeduperMainWindow::load_list()
if (!file.open(QIODevice::ReadOnly)) return;
this->marked.clear();
QTextStream in(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ in.setCodec("UTF-8");
+#endif
while(!in.atEnd())
{
QString && s = in.readLine();