parameters: (s, charset=None, language=None)
return_statement: return "%s'%s'%s" % (charset, language, s)
docstring: Encode string according to RFC 2231.
  
      If neither charset nor language is given, then s is returned as-is.  If
      charset is given but not language, the string is encoded using the empty
      string for language.
docstring_summary: Encode string according to RFC 2231.
docstring_tokens: Encode string according to RFC 2231 .
function: def encode_rfc2231(s, charset=None, language=None):
      """Encode string according to RFC 2231.
  
      If neither charset nor language is given, then s is returned as-is.  If
      charset is given but not language, the string is encoded using the empty
      string for language.
      """
      s = urllib.parse.quote(s, safe='', encoding=charset or 'ascii')
      if charset is None and language is None:
          return s
      if language is None:
          language = ''
      return "%s'%s'%s" % (charset, language, s)
function_tokens: def encode_rfc2231 ( s , charset = None , language = None ) : s = urllib . parse . quote ( s , safe = '' , encoding = charset or 'ascii' ) if charset is None and language is None : return s if language is None : language = '' return "%s'%s'%s" % ( charset , language , s )