mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Properly handle non ascii quoted URLs in OPF files
This commit is contained in:
parent
11c561e6f7
commit
ffc6d51e1d
@ -63,7 +63,11 @@ class Resource(object):
|
||||
if url[0] not in ('', 'file'):
|
||||
self._href = href_or_path
|
||||
else:
|
||||
self.path = os.path.abspath(os.path.join(basedir, unquote(url[2]).replace('/', os.sep)))
|
||||
pc = url[2]
|
||||
if isinstance(pc, unicode):
|
||||
pc.encode('utf-8')
|
||||
pc = unquote(pc).decode('utf-8')
|
||||
self.path = os.path.abspath(os.path.join(basedir, pc.replace('/', os.sep)))
|
||||
self.fragment = unquote(url[-1])
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user