diff --git a/src/calibre/ebooks/conversion/plugins/html_output.py b/src/calibre/ebooks/conversion/plugins/html_output.py index 3caa19ef2f..ba2e922267 100644 --- a/src/calibre/ebooks/conversion/plugins/html_output.py +++ b/src/calibre/ebooks/conversion/plugins/html_output.py @@ -79,7 +79,7 @@ class HTMLOutput(OutputFormatPlugin): from lxml import etree root = self.generate_toc(oeb_book, ref_url, output_dir) - return etree.tostring(root, pretty_print=True, encoding='utf-8', + return etree.tostring(root, pretty_print=True, encoding='unicode', xml_declaration=False) def convert(self, oeb_book, output_path, input_plugin, opts, log): @@ -161,14 +161,14 @@ class HTMLOutput(OutputFormatPlugin): # get & clean HTML
-data head = root.xpath('//h:head', namespaces={'h': 'http://www.w3.org/1999/xhtml'})[0] - head_content = etree.tostring(head, pretty_print=True, encoding='utf-8') + head_content = etree.tostring(head, pretty_print=True, encoding='unicode') head_content = re.sub(r'\<\/?head.*\>', '', head_content) head_content = re.sub(re.compile(r'\