def to_fs_from_unicode(unic):
 if is_unicode(unic):
  try:
   string = unic.encode(FS_ENCODING)
  except (UnicodeError, TypeError):
   pass
  else:
   return string
 return unic

def to_fs_from_unicode ( unic ) : if is_unicode ( unic ) : try : string = unic . encode ( FS_ENCODING ) except ( UnicodeError , TypeError ) : pass else : return string return unic
return a byte string version of unic encoded using the file system encoding .