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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user