From c7aabab2db30f5232605f885e0c879887010b13c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Feb 2010 14:01:15 -0700 Subject: [PATCH] MOBI metadata: Correctly handle long titles in non ASCII encodings when reading metadata --- src/calibre/ebooks/mobi/reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 38c77b6d06..88396b4346 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -67,7 +67,10 @@ class EXTHHeader(object): pass elif id == 503: # Long title if not title or title == _('Unknown'): - title = content + try: + title = content.decode(codec) + except: + pass #else: # print 'unknown record', id, repr(content) if title: