From bbe248698af2286fed5da0666e5230440c2d9ae8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 16 May 2013 16:41:20 +0900 Subject: [PATCH] correctly decode %-escaped utf8 when pasting (#865) --- aqt/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index b4208161c..ae2ee919a 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -1102,7 +1102,8 @@ class EditorWebView(AnkiWebView): return finally: self.editor.mw.progress.finish() - path = namedtmp(os.path.basename(urllib2.unquote(url))) + path = unicode(urllib2.unquote(url.encode("utf8")), "utf8") + path = namedtmp(os.path.basename(path)) file = open(path, "wb") file.write(filecontents) file.close()