def can_fs_encode(filename):
 if os.path.supports_unicode_filenames:
  return True
 try:
  filename.encode(sys.getfilesystemencoding())
 except UnicodeEncodeError:
  return False
 return True

def can_fs_encode ( filename ) : if os . path . supports_unicode_filenames : return True try : filename . encode ( sys . getfilesystemencoding ( ) ) except UnicodeEncodeError : return False return True
return true if the filename can be saved in the file system .