From d7c1af9b991c6e95ef049c715b1666564dada13c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Mar 2009 12:33:23 -0800 Subject: [PATCH] Fix #1981 (Problems whit unicone titles) --- src/calibre/ebooks/mobi/reader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 81bd510694..7d1aaba7b5 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -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