mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #349
This commit is contained in:
parent
09bfe43074
commit
698cece292
@ -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…
x
Reference in New Issue
Block a user