Permalink
Browse files

Merge pull request #490 from mspacek/svg-unicode

fix UnicodeEncodeError writing SVG string to .svg file
 
closes gh-489
  • Loading branch information...
2 parents 5163e14 + 35fb6d8 commit 6a0fa994ca6623d31221b1705f5cabc3b64596a9 @minrk minrk committed Jun 1, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 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')

0 comments on commit 6a0fa99

Please sign in to comment.