From aa36e1094a4ec3821681b39821e4bbe79cc19c2b Mon Sep 17 00:00:00 2001 From: "Marshall T. Vandegrift" Date: Tue, 6 Jan 2009 21:58:37 -0500 Subject: [PATCH] Additional support for reading UTF-8 encoded Mobipocket books. --- src/calibre/ebooks/mobi/reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 2163697d16..d76b5f1574 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -336,7 +336,9 @@ class MobiReader(object): while flags: if flags & 1: num += sizeof_trailing_entry(data, size - num) - flags >>= 1 + flags >>= 1 + if self.book_header.extra_flags & 1: + num += (ord(data[size - num - 1]) & 0x3) + 1 return num def text_section(self, index):