mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Metadata reader: Correctly handle non ASCII characters when reading embedded metadata. Fixes #4223 (trouble with charset)
This commit is contained in:
parent
b4216f7d81
commit
0ad8343cdc
@ -435,7 +435,8 @@ class MobiReader(object):
|
||||
open(os.path.splitext(htmlfile)[0] + '.ncx', 'wb').write(ncx)
|
||||
|
||||
def read_embedded_metadata(self, root, elem, guide):
|
||||
raw = '<package>' + html.tostring(elem, encoding='utf-8') + '</package>'
|
||||
raw = '<?xml version="1.0" encoding="utf-8" ?>\n<package>' + \
|
||||
html.tostring(elem, encoding='utf-8') + '</package>'
|
||||
stream = cStringIO.StringIO(raw)
|
||||
opf = OPF(stream)
|
||||
self.embedded_mi = MetaInformation(opf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user