From e84310af6397f2afb25aa0011289482be0c60793 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Feb 2010 11:30:59 -0700 Subject: [PATCH] MOBI Output: Encode titles as UTF-8 in the PalmDoc header as well as the EXTH header, since there are apparently MOBI readers that use the title from the PalmDoc header in preference to the title from the EXTH header. --- src/calibre/ebooks/mobi/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 8de702a617..0f26e25609 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -1376,7 +1376,7 @@ class MobiWriter(object): self._text_length, self._text_nrecords-1, RECORD_SIZE, 0, 0)) # 0 - 15 (0x0 - 0xf) uid = random.randint(0, 0xffffffff) - title = str(metadata.title[0]) + title = unicode(metadata.title[0]).encode('utf-8') # The MOBI Header # 0x0 - 0x3