From dd78a41171a83ab1d05dec93d98198162b223ae2 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 23 Feb 2018 00:13:14 -0500 Subject: [PATCH] Fix HTML export (more encoding stuff). Also fix old bug in which unicode fit names don't display correctly in the webbrowser. #1411 --- gui/utils/exportHtml.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 984505021..612df367e 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -63,12 +63,14 @@ class exportHtmlThread(threading.Thread): HTML = self.generateFullHTML(sMkt, sFit, dnaUrl) try: - FILE = open(settings.getPath(), "w") - FILE.write(HTML.encode('utf-8')) + FILE = open(settings.getPath(), "w", encoding='utf-8') + FILE.write(HTML) FILE.close() - except IOError: + except IOError as ex: print(("Failed to write to " + settings.getPath())) pass + except Exception as ex: + pass if self.callback: wx.CallAfter(self.callback, -1) @@ -84,6 +86,7 @@ class exportHtmlThread(threading.Thread): Pyfa Fittings +