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-29 13:56:17 -03:00
committed by Adrián Insaurralde Avalos
parent 865997597a
commit 88fae786a5
+3
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;