From: apprenticeharper Date: Tue, 8 Sep 2015 06:52:06 +0000 (+0100) Subject: More changes to the obok cli interface for character encodings X-Git-Url: http://git.xmof.duckdns.org/?a=commitdiff_plain;h=2e96db6cdcd310902c4711c60014cec9cef67153;p=DeDRM.git More changes to the obok cli interface for character encodings --- diff --git a/Obok_calibre_plugin/obok_plugin.zip b/Obok_calibre_plugin/obok_plugin.zip index 144ad0e..3e1b918 100644 Binary files a/Obok_calibre_plugin/obok_plugin.zip and b/Obok_calibre_plugin/obok_plugin.zip differ diff --git a/Obok_calibre_plugin/obok_plugin/obok/obok.py b/Obok_calibre_plugin/obok_plugin/obok/obok.py index d619a26..18e629b 100644 --- a/Obok_calibre_plugin/obok_plugin/obok/obok.py +++ b/Obok_calibre_plugin/obok_plugin/obok/obok.py @@ -486,7 +486,7 @@ def cli_main(): lib = KoboLibrary() for i, book in enumerate(lib.books): - print ('%d: %s' % (i + 1, book.title)).encode('ascii', 'ignore') + print ('%d: %s' % (i + 1, book.title)) num_string = raw_input("Convert book number... ") try: @@ -499,7 +499,7 @@ def cli_main(): zin = zipfile.ZipFile(book.filename, "r") # make filename out of Unicode alphanumeric and whitespace equivalents from title - outname = "%s.epub" % (re.sub('[^\s\w]', '', book.title, 0, re.UNICODE)) + outname = "%s.epub" % (re.sub('[^\s\w]', '_', book.title, 0, re.UNICODE)) if (book.type == 'drm-free'): print "DRM-free book, conversion is not needed" diff --git a/Other_Tools/Kobo/obok.py b/Other_Tools/Kobo/obok.py index d619a26..18e629b 100644 --- a/Other_Tools/Kobo/obok.py +++ b/Other_Tools/Kobo/obok.py @@ -486,7 +486,7 @@ def cli_main(): lib = KoboLibrary() for i, book in enumerate(lib.books): - print ('%d: %s' % (i + 1, book.title)).encode('ascii', 'ignore') + print ('%d: %s' % (i + 1, book.title)) num_string = raw_input("Convert book number... ") try: @@ -499,7 +499,7 @@ def cli_main(): zin = zipfile.ZipFile(book.filename, "r") # make filename out of Unicode alphanumeric and whitespace equivalents from title - outname = "%s.epub" % (re.sub('[^\s\w]', '', book.title, 0, re.UNICODE)) + outname = "%s.epub" % (re.sub('[^\s\w]', '_', book.title, 0, re.UNICODE)) if (book.type == 'drm-free'): print "DRM-free book, conversion is not needed"