From b4c5cd0122b0afd540862c1eee7708a3be1d9baa Mon Sep 17 00:00:00 2001 From: ldolse Date: Wed, 19 Jan 2011 00:41:59 +0800 Subject: [PATCH] fix calls to create_oebbook, mark several strings as unicode --- src/calibre/ebooks/chm/input.py | 2 +- src/calibre/ebooks/conversion/utils.py | 6 +++--- src/calibre/ebooks/html/input.py | 2 +- src/calibre/ebooks/snb/input.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calibre/ebooks/chm/input.py b/src/calibre/ebooks/chm/input.py index c4b124fe98..89efa2b4d1 100644 --- a/src/calibre/ebooks/chm/input.py +++ b/src/calibre/ebooks/chm/input.py @@ -75,7 +75,7 @@ class CHMInput(InputFormatPlugin): def _create_oebbook(self, hhcpath, basedir, opts, log, mi): from calibre.ebooks.conversion.plumber import create_oebbook from calibre.ebooks.oeb.base import DirContainer - oeb = create_oebbook(log, None, opts, self, + oeb = create_oebbook(log, None, opts, encoding=opts.input_encoding, populate=False) self.oeb = oeb diff --git a/src/calibre/ebooks/conversion/utils.py b/src/calibre/ebooks/conversion/utils.py index 812a863717..9ae8e5ab6f 100644 --- a/src/calibre/ebooks/conversion/utils.py +++ b/src/calibre/ebooks/conversion/utils.py @@ -299,9 +299,9 @@ class HeuristicProcessor(object): supports a range of html markup and text files ''' # define the pieces of the regex - lookahead = "(?<=.{"+str(length)+"}([a-zäëïöüàèìòùáćéíóńśúâêîôûçąężıãõñæøþðßě,:)\IA\u00DF]|(?\s*()?" blanklines = "\s*(?P<(p|span|div)[^>]*>\s*(<(p|span|div)[^>]*>\s*\s*)\s*){0,3}\s*" line_opening = "<(span|[iubp]|div)[^>]*>\s*(<(span|[iubp]|div)[^>]*>)?\s*" diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index ed0bf7b3ef..080faffae6 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -295,7 +295,7 @@ class HTMLInput(InputFormatPlugin): return oeb from calibre.ebooks.conversion.plumber import create_oebbook - return create_oebbook(log, stream.name, opts, self, + return create_oebbook(log, stream.name, opts, encoding=opts.input_encoding) def is_case_sensitive(self, path): diff --git a/src/calibre/ebooks/snb/input.py b/src/calibre/ebooks/snb/input.py index d2acb257aa..100ac1447f 100755 --- a/src/calibre/ebooks/snb/input.py +++ b/src/calibre/ebooks/snb/input.py @@ -41,7 +41,7 @@ class SNBInput(InputFormatPlugin): raise ValueError("Invalid SNB file") log.debug("Handle meta data ...") from calibre.ebooks.conversion.plumber import create_oebbook - oeb = create_oebbook(log, None, options, self, + oeb = create_oebbook(log, None, options, encoding=options.input_encoding, populate=False) meta = snbFile.GetFileStream('snbf/book.snbf') if meta != None: