mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 04:03:52 +02: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
1 changed files with 2 additions and 1 deletions
|
|
@ -435,7 +435,8 @@ def extract_content(self, output_dir, parse_cache):
|
|||
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…
Reference in a new issue