mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change to fix to make the value unicode in format_field_extended. This is a more general fix. Note that the orig_field has not been changed.
This commit is contained in:
parent
f280cc956f
commit
8a9ae38ebf
@ -45,7 +45,7 @@ class SafeFormat(string.Formatter):
|
||||
return ''
|
||||
if v == '':
|
||||
return ''
|
||||
return prefix + unicode(v) + suffix
|
||||
return prefix + v + suffix
|
||||
except:
|
||||
return key
|
||||
|
||||
@ -444,7 +444,7 @@ class Metadata(object):
|
||||
res = format_date(res, cmeta['display'].get('date_format','dd MMM yyyy'))
|
||||
elif datatype == 'bool':
|
||||
res = _('Yes') if res else _('No')
|
||||
return (name, res, orig_res, cmeta)
|
||||
return (name, unicode(res), orig_res, cmeta)
|
||||
|
||||
if key in field_metadata and field_metadata[key]['kind'] == 'field':
|
||||
res = self.get(key, None)
|
||||
@ -462,7 +462,7 @@ class Metadata(object):
|
||||
res = res + ' [%s]'%self.format_series_index()
|
||||
elif datatype == 'datetime':
|
||||
res = format_date(res, fmeta['display'].get('date_format','dd MMM yyyy'))
|
||||
return (name, res, orig_res, fmeta)
|
||||
return (name, unicode(res), orig_res, fmeta)
|
||||
|
||||
return (None, None, None, None)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user