mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3338 (eReader not converting properly)
This commit is contained in:
parent
8d55963bbd
commit
ff6a6ae9e4
@ -50,7 +50,7 @@ class Reader132(FormatReader):
|
||||
def __init__(self, header, stream, log, options):
|
||||
self.log = log
|
||||
self.encoding = options.input_encoding
|
||||
|
||||
|
||||
self.log.debug('132 byte header version found.')
|
||||
|
||||
self.sections = []
|
||||
@ -105,7 +105,10 @@ class Reader132(FormatReader):
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
html = u'<html><head><title>%s</title></head><body>' % self.mi.title
|
||||
title = self.mi.title
|
||||
if not isinstance(title, unicode):
|
||||
title = title.decode('utf-8', 'replace')
|
||||
html = u'<html><head><title>%s</title></head><body>' % title
|
||||
|
||||
pml = u''
|
||||
for i in range(1, self.header_record.num_text_pages + 1):
|
||||
|
@ -92,8 +92,12 @@ class Reader202(FormatReader):
|
||||
self.log.debug('Extracting text page %i' % i)
|
||||
pml += self.get_text_page(i)
|
||||
|
||||
title = self.mi.title
|
||||
if not isinstance(title, unicode):
|
||||
title = title.decode('utf-8', 'replace')
|
||||
|
||||
html = u'<html><head><title>%s</title></head><body>%s</body></html>' % \
|
||||
(self.mi.title, pml_to_html(pml))
|
||||
(title, pml_to_html(pml))
|
||||
|
||||
with CurrentDir(output_dir):
|
||||
with open('index.html', 'wb') as index:
|
||||
|
@ -13,7 +13,7 @@ class PluginWidget(Widget, Ui_Form):
|
||||
HELP = _('Options specific to')+' PDB '+_('input')
|
||||
|
||||
def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
||||
Widget.__init__(self, parent, 'txt_input',
|
||||
Widget.__init__(self, parent, 'pdb_input',
|
||||
['single_line_paras'])
|
||||
self.db, self.book_id = db, book_id
|
||||
self.initialize_options(get_option, get_help, db, book_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user