HTMLZ Output: Fix an error when converting a document that has SVG images

This commit is contained in:
Kovid Goyal 2020-10-02 19:21:24 +05:30
parent 5c7b4b340a
commit 833c0db683
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -99,7 +99,7 @@ class HTMLZOutput(OutputFormatPlugin):
for item in oeb_book.manifest:
if item.media_type in OEB_IMAGES and item.href in images:
if item.media_type == SVG_MIME:
data = etree.tostring(item.data, encoding='unicode')
data = etree.tostring(item.data, encoding='unicode').encode('utf-8')
else:
data = item.data
fname = os.path.join(tdir, u'images', images[item.href])