Skip to content

Commit

Permalink
FEM: Ignore unicode conversion errors
Browse files Browse the repository at this point in the history
Solution suggested by shoogen
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 23, 2015
1 parent c5850e5 commit 129cc88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -251,7 +251,7 @@ def __init__(self,object):

def femConsoleMessage(self, message="", color="#000000"):
self.fem_console_message = self.fem_console_message + '<font color="#0000FF">{0:4.1f}:</font> <font color="{1}">{2}</font><br>'.\
format(time.time() - self.Start, color, message.encode('utf-8'))
format(time.time() - self.Start, color, message.encode('utf-8', 'replace'))
self.form.textEdit_Output.setText(self.fem_console_message)

def printCalculiXstdout(self):
Expand All @@ -262,7 +262,7 @@ def printCalculiXstdout(self):
self.femConsoleMessage("CalculiX stdout is empty", "#FF0000")
else:
try:
out = unicode(out, 'utf-8')
out = unicode(out, 'utf-8', 'replace')
rx = QtCore.QRegExp("\\*ERROR.*\\n\\n")
rx.setMinimal(True)
pos = rx.indexIn(out)
Expand Down

0 comments on commit 129cc88

Please sign in to comment.