mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-28 07:15:02 +01:00
HTMLZ Output: Fix HTML files being created with system encoding instead of UTF-8. Fixes #1499514 [Latin encode error while converting from epub to htmlz](https://bugs.launchpad.net/calibre/+bug/1499514)
This commit is contained in:
parent
fb7357f59f
commit
eeccbf395c
1 changed files with 2 additions and 0 deletions
|
|
@ -70,6 +70,8 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
from calibre.utils.filenames import shorten_components_to
|
||||
fname = shorten_components_to(100, (ascii_filename(unicode(oeb_book.metadata.title[0])),))[0]
|
||||
with open(os.path.join(tdir, fname+u'.html'), 'wb') as tf:
|
||||
if isinstance(html, unicode):
|
||||
html = html.encode('utf-8')
|
||||
tf.write(html)
|
||||
|
||||
# CSS
|
||||
|
|
|
|||
Loading…
Reference in a new issue