ZIP Output: Fix system encoding being used instead of UTF-8 for html files. See #1499514 (Latin encode error while converting from epub to htmlz)

This commit is contained in:
Kovid Goyal 2015-09-25 22:41:54 +05:30
parent 781c28fe1d
commit d56d1c8d37
2 changed files with 3 additions and 1 deletions

View File

@ -127,6 +127,8 @@ class HTMLOutput(OutputFormatPlugin):
toc=html_toc, meta=meta, nextLink=nextLink,
tocUrl=tocUrl, cssLink=cssLink,
firstContentPageLink=nextLink)
if isinstance(t, unicode):
t = t.encode('utf-8')
f.write(t)
with CurrentDir(output_dir):

View File

@ -84,4 +84,4 @@ class Templite(object):
def write(self, *args):
for a in args:
self.__output.append(str(a))
self.__output.append(unicode(a))