fix UnicodeEncodeError writing SVG string to .svg file, fixes #489 #490

Merged
merged 2 commits into from Jun 1, 2011
View
3 IPython/frontend/qt/svg.py
@@ -21,6 +21,9 @@ def save_svg(string, parent=None):
The name of the file to which the document was saved, or None if the save
was cancelled.
"""
+ if isinstance(string, unicode):
+ string = string.encode('utf-8')
+
dialog = QtGui.QFileDialog(parent, 'Save SVG Document')
dialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
dialog.setDefaultSuffix('svg')