mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -8,6 +8,7 @@ import StringIO, sys
|
|||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
|
from calibre import force_unicode
|
||||||
|
|
||||||
class StreamSlicer(object):
|
class StreamSlicer(object):
|
||||||
|
|
||||||
@ -245,7 +246,9 @@ class MetadataUpdater(object):
|
|||||||
def get_metadata(self):
|
def get_metadata(self):
|
||||||
''' Return MetaInformation with title, author'''
|
''' Return MetaInformation with title, author'''
|
||||||
self.get_original_metadata()
|
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):
|
def get_original_metadata(self):
|
||||||
offset = self.base + self.topaz_headers['metadata']['blocks'][0]['offset']
|
offset = self.base + self.topaz_headers['metadata']['blocks'][0]['offset']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user