Fix Bug #3338: Handle strange characters in eReader metadata title.

This commit is contained in:
John Schember 2009-08-29 11:09:49 -04:00
parent 5589a06447
commit 813d9eb14f
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class Reader132(FormatReader):
if not os.path.exists(output_dir): if not os.path.exists(output_dir):
os.makedirs(output_dir) os.makedirs(output_dir)
html = u'<html><head><title>%s</title></head><body>' % self.mi.title html = u'<html><head><title>%s</title></head><body>' % self.mi.title.decode('utf-8', 'replace')
pml = u'' pml = u''
for i in range(1, self.header_record.num_text_pages + 1): for i in range(1, self.header_record.num_text_pages + 1):

View File

@ -93,7 +93,7 @@ class Reader202(FormatReader):
pml += self.get_text_page(i) pml += self.get_text_page(i)
html = u'<html><head><title>%s</title></head><body>%s</body></html>' % \ html = u'<html><head><title>%s</title></head><body>%s</body></html>' % \
(self.mi.title, pml_to_html(pml)) (self.mi.title.decode('utf-8', 'replace'), pml_to_html(pml))
with CurrentDir(output_dir): with CurrentDir(output_dir):
with open('index.html', 'wb') as index: with open('index.html', 'wb') as index: