Fix #1981 (Problems whit unicone titles)

This commit is contained in:
Kovid Goyal 2009-03-04 12:33:23 -08:00
parent 750461e3ba
commit d7c1af9b99

View File

@ -126,6 +126,8 @@ class BookHeader(object):
self.exth_flag, = struct.unpack('>L', raw[0x80:0x84])
self.exth = None
if not isinstance(self.title, unicode):
self.title = self.title.decode(self.codec, 'replace')
if self.exth_flag & 0x40:
self.exth = EXTHHeader(raw[16+self.length:], self.codec, self.title)
self.exth.mi.uid = self.unique_id