mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-25 11:07:11 +01:00
Fix #349
This commit is contained in:
parent
09bfe43074
commit
698cece292
1 changed files with 2 additions and 0 deletions
|
|
@ -66,6 +66,8 @@ def load_library(name, cdll):
|
|||
|
||||
def filename_to_utf8(name):
|
||||
'''Return C{name} encoded in utf8. Unhandled characters are replaced. '''
|
||||
if isinstance(name, unicode):
|
||||
return name.encode('utf8')
|
||||
codec = 'cp1252' if iswindows else 'utf8'
|
||||
return name.decode(codec, 'replace').encode('utf8')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue