From 8fcf04a9be76b5e138992a834930d355e737c63e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Jun 2008 22:29:53 -0700 Subject: [PATCH] IGN:... --- src/calibre/ebooks/lrf/html/convert_from.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index 5b5628424c..457837aa30 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -260,6 +260,7 @@ class HTMLConverter(object, LoggingInterface): paths = [os.path.abspath(path) for path in paths] + paths = [path.decode(sys.getfilesystemencoding()) if not isinstance(path, unicode) else path for path in paths] while len(paths) > 0 and self.link_level <= self.link_levels: for path in paths: @@ -380,6 +381,8 @@ class HTMLConverter(object, LoggingInterface): self.log_info(_('\tConverting to BBeB...')) self.current_style = {} self.page_break_found = False + if not isinstance(path, unicode): + path = path.decode(sys.getfilesystemencoding()) self.target_prefix = path self.previous_text = '\n' self.tops[path] = self.parse_file(soup) @@ -628,6 +631,8 @@ class HTMLConverter(object, LoggingInterface): para, text, path, fragment = link['para'], link['text'], link['path'], link['fragment'] ascii_text = text + if not isinstance(path, unicode): + path = path.decode(sys.getfilesystemencoding()) if path in self.processed_files: if path+fragment in self.targets.keys(): tb = get_target_block(path+fragment, self.targets)