def encode_local(string):
 if is_python3():
  return string
 return string.encode((sys.getfilesystemencoding() or 'utf-8'))

def encode_local ( string ) : if is_python3 ( ) : return string return string . encode ( ( sys . getfilesystemencoding ( ) or 'utf-8' ) )
converts string into users preferred encoding .