Fix #4690 (Error while sending book with non-ascii character in title/author to device)

This commit is contained in:
Kovid Goyal 2010-01-26 09:29:53 -07:00
parent e87c1cc343
commit c3cba391b7

View File

@ -808,6 +808,8 @@ class Device(DeviceConfig, DevicePlugin):
ext = os.path.splitext(fname)[1]
from calibre.library.save_to_disk import get_components
if not isinstance(template, unicode):
template = template.decode('utf-8')
extra_components = get_components(template, mdata, fname)
if not extra_components:
extra_components.append(sanitize(self.filename_callback(fname,