def filename_to_utf8(name):
 if isinstance(name, unicode):
  return name.encode('utf8')
 codec = ('cp1252' if iswindows else 'utf8')
 return name.decode(codec, 'replace').encode('utf8')

def filename_to_utf8 ( name ) : if isinstance ( name , unicode ) : return name . encode ( 'utf8' ) codec = ( 'cp1252' if iswindows else 'utf8' ) return name . decode ( codec , 'replace' ) . encode ( 'utf8' )
return c{name} encoded in utf8 .