ID EN
Urllib Parse

quote

Python 3.11

Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.-~' are never quoted. By default, this function is intended for quoting the path section of a URL. The optional safe parameter specifies additional ASCII characters that should not be quoted — its default value is '/'.

Syntax

PYTHON
urllib.parse.quote(string, safe='/', encoding=None, errors=None)

See Also

str bytes str.encode() UnicodeEncodeError bytes TypeError