def url_quote_plus(s, charset='utf-8', safe=''):
 if isinstance(s, unicode):
  s = s.encode(charset)
 elif (not isinstance(s, str)):
  s = str(s)
 return _quote_plus(s, safe=safe)

def url_quote_plus ( s , charset = 'utf-8' , safe = '' ) : if isinstance ( s , unicode ) : s = s . encode ( charset ) elif ( not isinstance ( s , str ) ) : s = str ( s ) return _quote_plus ( s , safe = safe )
url encode a single string with the given encoding and convert whitespace to "+" .