Gui: use utf-8 encoding for saving recorded macros

FCMacros always have the header "# -*- coding: utf-8 -*".
But the QTextStream class in Qt5 does not always use utf-8 for saving the text file.
This commit is contained in:
bdieterm
2024-11-17 11:04:40 +01:00
committed by WandererFan
parent d9a4f8a590
commit 9410a5e982

View File

@@ -80,6 +80,9 @@ bool MacroFile::commit()
// sort import lines and avoid duplicates
QTextStream str(&file);
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
str.setCodec("UTF-8");
#endif
QStringList import;
import << QString::fromLatin1("import FreeCAD");
QStringList body;