From 833c0db683e5c427ff6088982913e5026d290787 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 2 Oct 2020 19:21:24 +0530 Subject: [PATCH] HTMLZ Output: Fix an error when converting a document that has SVG images --- src/calibre/ebooks/conversion/plugins/htmlz_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/conversion/plugins/htmlz_output.py b/src/calibre/ebooks/conversion/plugins/htmlz_output.py index 88b9f6b1e8..ac7a6d4231 100644 --- a/src/calibre/ebooks/conversion/plugins/htmlz_output.py +++ b/src/calibre/ebooks/conversion/plugins/htmlz_output.py @@ -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])