From 5acdcc184f701528102a81e39e9873e18e3ff443 2011-06-01 03:36:29 From: Martin Spacek Date: 2011-06-01 03:36:29 Subject: [PATCH] fix UnicodeEncodeError writing SVG string to .svg file, fixes #489 --- diff --git a/IPython/frontend/qt/svg.py b/IPython/frontend/qt/svg.py index 8081dca..01cb41f 100644 --- a/IPython/frontend/qt/svg.py +++ b/IPython/frontend/qt/svg.py @@ -29,7 +29,7 @@ def save_svg(string, parent=None): filename = dialog.selectedFiles()[0] f = open(filename, 'w') try: - f.write(string) + f.write(string.encode('UTF-8')) finally: f.close() return filename