mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04: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
@ -70,6 +70,8 @@ class HTMLZOutput(OutputFormatPlugin):
|
||||
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…
x
Reference in New Issue
Block a user