mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle unicode metadata in the book list.
This commit is contained in:
parent
b3d74f9a89
commit
e50f30392d
@ -49,7 +49,9 @@ class book_metadata_field(object):
|
||||
def __set__(self, obj, val):
|
||||
""" Set the attribute """
|
||||
val = self.setter(val) if self.setter else val
|
||||
obj.elem.setAttribute(self.attr, str(val))
|
||||
if not isinstance(val, unicode):
|
||||
val = unicode(val, 'utf8', 'replace')
|
||||
obj.elem.setAttribute(self.attr, val)
|
||||
|
||||
class Book(object):
|
||||
""" Provides a view onto the XML element that represents a book """
|
||||
|
Loading…
x
Reference in New Issue
Block a user