Skip to main content

Python: How to Unescape String (DecodeURI in JavaScript)

Decoding

We can use urllib module to do this. This is on Python 2.7x and Python 3+ (added).


Encoding

The opposite of that function is urllib.quote(string) (Python 2) with additional argument to create a custom safe characters list. This is the documentation.

For Python 3, there is urllib.parse.quote(). But there are others: quote_plus and quote_from_bytes.

This is the urllib.parse.quote() documentation for Python 3.

UNCESCAPE PLATYPUS
Last modified on

Comments

Monkey Raptor uses cookies or biscuits 🍪 for analytics, functionality, and advertisements. More info in Privacy Policy