From ed1758bb30b0f8469e07a85e655a6b7c2eaa2142 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Dec 2008 03:27:26 +0900 Subject: [PATCH] pass unicode name to qt --- ankiqt/ui/facteditor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index d88be1522..af3f1cb86 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -578,7 +578,8 @@ class FactEdit(QTextEdit): if source.hasImage(): im = QImage(source.imageData()) (fd, name) = tempfile.mkstemp(suffix=".jpg") - im.save(name, None, 95) + uname = unicode(name, sys.getfilesystemencoding()) + im.save(uname, None, 95) self.parent._addPicture(name, widget=self) return if source.hasHtml():