Fix #2350 (conversion of a mobipocket file (huffdic compressed) fail)

This commit is contained in:
Kovid Goyal 2009-04-26 15:25:25 -07:00
parent 54dd263be1
commit 8e68f9d4dd
2 changed files with 35 additions and 32 deletions

View File

@ -382,6 +382,7 @@ class MobiReader(object):
}
mobi_version = self.book_header.mobi_version
for tag in root.iter(etree.Element):
tag.attrib.pop('xmlns', '')
if tag.tag in ('country-region', 'place', 'placetype', 'placename',
'state', 'city', 'street', 'address', 'content'):
tag.tag = 'div' if tag.tag == 'content' else 'span'

View File

@ -177,6 +177,8 @@ class ProgressBar:
self.width = self.term.COLS or 75
self.bar = term.render(self.BAR)
self.header = self.term.render(self.HEADER % header.center(self.width))
if isinstance(self.header, unicode):
self.header = self.header.encode('utf-8')
self.cleared = 1 #: true if we haven't drawn the bar yet.
def update(self, percent, message=''):