diff --git a/src/calibre/ebooks/chm/input.py b/src/calibre/ebooks/chm/input.py index 61160e8dac..fce07c2359 100644 --- a/src/calibre/ebooks/chm/input.py +++ b/src/calibre/ebooks/chm/input.py @@ -52,6 +52,9 @@ class CHMInput(InputFormatPlugin): metadata = get_metadata_from_reader(self._chm_reader) self._chm_reader.CloseCHM() + #print tdir + #from calibre import ipython + #ipython() odi = options.debug_pipeline options.debug_pipeline = None diff --git a/src/calibre/ebooks/chm/reader.py b/src/calibre/ebooks/chm/reader.py index 34d228ef3b..7c9a6bf48a 100644 --- a/src/calibre/ebooks/chm/reader.py +++ b/src/calibre/ebooks/chm/reader.py @@ -147,7 +147,8 @@ class CHMReader(CHMFile): if self.hhc_path == '.hhc' and self.hhc_path not in files: from calibre import walk for x in walk(output_dir): - if os.path.basename(x).lower() in ('index.htm', 'index.html'): + if os.path.basename(x).lower() in ('index.htm', 'index.html', + 'contents.htm', 'contents.html'): self.hhc_path = os.path.relpath(x, output_dir) break diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index e5f2cace7f..58083f807f 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -24,7 +24,7 @@ from calibre.translations.dynamic import translate from calibre.ebooks.chardet import xml_to_unicode from calibre.ebooks.oeb.entitydefs import ENTITYDEFS from calibre.ebooks.conversion.preprocess import CSSPreProcessor -from calibre import isbytestring +from calibre import isbytestring, as_unicode RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True) @@ -643,7 +643,7 @@ class Metadata(object): return unicode(self.value).encode('ascii', 'xmlcharrefreplace') def __unicode__(self): - return unicode(self.value) + return as_unicode(self.value) def to_opf1(self, dcmeta=None, xmeta=None, nsrmap={}): attrib = {}