From bda14d28d2763ba84c78800022d2f06e4677d3e2 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 7 Oct 2022 23:24:56 -0400 Subject: Force UTF-8 codec on qt < 6.0. Patch by @BLumia. --- qdeduper/mingui.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qdeduper') 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(); -- cgit v1.2.3