mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't throw error when invalid utf8 found in % escape
This commit is contained in:
parent
21f5132c0b
commit
8a414fff29
1 changed files with 2 additions and 1 deletions
|
@ -477,7 +477,8 @@ class Editor(object):
|
||||||
# misbehaving apps may include a null byte in the text
|
# misbehaving apps may include a null byte in the text
|
||||||
txt = txt.replace("\x00", "")
|
txt = txt.replace("\x00", "")
|
||||||
# reverse the url quoting we added to get images to display
|
# 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.note.fields[self.currentField] = txt
|
||||||
self.mw.requireReset()
|
self.mw.requireReset()
|
||||||
if not self.addMode:
|
if not self.addMode:
|
||||||
|
|
Loading…
Reference in a new issue