mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 01:46:48 +01:00
When reading metadata from Topaz (azw1) files, handle non ascii metadata correctly. Fixes #917419 (Private bug)
This commit is contained in:
parent
a19fdb42cd
commit
28c1b8f113
1 changed files with 4 additions and 1 deletions
|
|
@ -8,6 +8,7 @@
|
|||
from struct import pack
|
||||
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
from calibre import force_unicode
|
||||
|
||||
class StreamSlicer(object):
|
||||
|
||||
|
|
@ -245,7 +246,9 @@ def generate_metadata_stream(self):
|
|||
def get_metadata(self):
|
||||
''' Return MetaInformation with title, author'''
|
||||
self.get_original_metadata()
|
||||
return MetaInformation(self.metadata['Title'], [self.metadata['Authors']])
|
||||
title = force_unicode(self.metadata['Title'], 'utf-8')
|
||||
authors = force_unicode(self.metadata['Authors'], 'utf-8').split(';')
|
||||
return MetaInformation(title, authors)
|
||||
|
||||
def get_original_metadata(self):
|
||||
offset = self.base + self.topaz_headers['metadata']['blocks'][0]['offset']
|
||||
|
|
|
|||
Loading…
Reference in a new issue