From fb2968c8f0c5c03a904eb52c90629c851cae06a6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 30 Oct 2009 10:36:57 -0600 Subject: [PATCH] HTML Input: Convert file names to ASCII as windows based software often can't handle non ASCII file names in zip files. Fixes #3693 (HTML->EPUB on Sony PRS-505 with non standard characters) --- src/calibre/ebooks/html/input.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 202475d7c9..e39e46d8cb 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -23,6 +23,7 @@ from calibre.customize.conversion import OptionRecommendation from calibre.constants import islinux from calibre import unicode_path from calibre.utils.localization import get_lang +from calibre.utils.filenames import ascii_filename class Link(object): ''' @@ -333,9 +334,11 @@ class HTMLInput(InputFormatPlugin): htmlfile_map = {} for f in filelist: path = f.path + print 111, path, repr(path), repr(os.path.dirname(path)) oeb.container = DirContainer(os.path.dirname(path), log) bname = os.path.basename(path) - id, href = oeb.manifest.generate(id='html', href=bname) + id, href = oeb.manifest.generate(id='html', + href=ascii_filename(bname)) htmlfile_map[path] = href item = oeb.manifest.add(id, href, 'text/html') item.html_input_href = bname