From 8a414fff295e71250768bce7983ccda41520fdc1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 15 Jun 2012 02:19:33 +0900 Subject: [PATCH] don't throw error when invalid utf8 found in % escape --- aqt/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index d0be1543c..3c85c6fba 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -477,7 +477,8 @@ class Editor(object): # misbehaving apps may include a null byte in the text txt = txt.replace("\x00", "") # reverse the url quoting we added to get images to display - txt = unicode(urllib2.unquote(txt.encode("utf8")), "utf8") + txt = unicode(urllib2.unquote( + txt.encode("utf8")), "utf8", "replace") self.note.fields[self.currentField] = txt self.mw.requireReset() if not self.addMode: