mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1093 (epub conversion from mobi fails)
This commit is contained in:
parent
4170d9125f
commit
80dad7f79a
@ -534,10 +534,15 @@ class OPF(object):
|
|||||||
return self.guide_path(self.root)
|
return self.guide_path(self.root)
|
||||||
|
|
||||||
def unquote_urls(self):
|
def unquote_urls(self):
|
||||||
|
def get_href(item):
|
||||||
|
raw = unquote(item.get('href', ''))
|
||||||
|
if not isinstance(raw, unicode):
|
||||||
|
raw = raw.decode('utf-8')
|
||||||
|
return raw
|
||||||
for item in self.itermanifest():
|
for item in self.itermanifest():
|
||||||
item.set('href', unquote(item.get('href', '')))
|
item.set('href', get_href(item))
|
||||||
for item in self.iterguide():
|
for item in self.iterguide():
|
||||||
item.set('href', unquote(item.get('href', '')))
|
item.set('href', get_href(item))
|
||||||
|
|
||||||
@apply
|
@apply
|
||||||
def authors():
|
def authors():
|
||||||
|
@ -160,7 +160,7 @@ class MobiReader(object):
|
|||||||
|
|
||||||
|
|
||||||
self.book_header = BookHeader(self.sections[0][0], self.ident)
|
self.book_header = BookHeader(self.sections[0][0], self.ident)
|
||||||
|
self.name = self.name.decode(self.book_header.codec, 'replace')
|
||||||
|
|
||||||
def extract_content(self, output_dir=os.getcwdu()):
|
def extract_content(self, output_dir=os.getcwdu()):
|
||||||
output_dir = os.path.abspath(output_dir)
|
output_dir = os.path.abspath(output_dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user