Skip to content

Commit

Permalink
Material: Fixed encoding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Nov 22, 2018
1 parent 9fc8446 commit 652e1db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mod/Material/MaterialEditor.py
Expand Up @@ -333,7 +333,10 @@ def openfile(self):

def savefile(self):
"Saves a FCMat file"
name = str(self.widget.Editor.findItems(translate("Material", "Name"), QtCore.Qt.MatchRecursive, 0)[0].text(1))
name = self.widget.Editor.findItems(translate("Material", "Name"), QtCore.Qt.MatchRecursive, 0)[0].text(1)
if sys.version_info.major < 3:
if isinstance(name,unicode):
name = name.encode("utf8")
if not name:
name = "Material"
filetuple = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), 'Save FreeCAD Material file', name + '.FCMat')
Expand Down

0 comments on commit 652e1db

Please sign in to comment.