diff --git a/src/calibre/ebooks/oeb/polish/images.py b/src/calibre/ebooks/oeb/polish/images.py index 31a203f2c0..23d06d979f 100644 --- a/src/calibre/ebooks/oeb/polish/images.py +++ b/src/calibre/ebooks/oeb/polish/images.py @@ -9,7 +9,7 @@ from functools import partial from threading import Thread, Event from Queue import Queue, Empty -from calibre import detect_ncpus, human_readable +from calibre import detect_ncpus, human_readable, force_unicode, filesystem_encoding class Worker(Thread): @@ -82,6 +82,7 @@ def compress_images(container, report=None, names=None, jpeg_quality=None, progr queue.join() before_total = after_total = 0 for name, (ok, res) in results.iteritems(): + name = force_unicode(name, filesystem_encoding) if ok: before, after = res if before != after: diff --git a/src/calibre/gui2/tweak_book/polish.py b/src/calibre/gui2/tweak_book/polish.py index ab78d82f92..9a2278521b 100644 --- a/src/calibre/gui2/tweak_book/polish.py +++ b/src/calibre/gui2/tweak_book/polish.py @@ -15,7 +15,7 @@ from PyQt5.Qt import ( QProgressBar, pyqtSignal ) -from calibre import human_readable, fit_image +from calibre import human_readable, fit_image, force_unicode from calibre.ebooks.oeb.polish.main import CUSTOMIZATION from calibre.gui2.tweak_book import tprefs, current_container, set_current_container from calibre.gui2.tweak_book.widgets import Dialog @@ -56,7 +56,8 @@ def get_customization(action, name, parent): def format_report(title, report): from calibre.ebooks.markdown import markdown - return markdown('# %s\n\n'%title + '\n\n'.join(report), output_format='html4') + report = [force_unicode(line) for line in report] + return markdown('# %s\n\n'%force_unicode(title) + '\n\n'.join(report), output_format='html4') def show_report(changed, title, report, parent, show_current_diff): report = format_report(title, report)