Given this:It%27s%20me%21
Unencode it and turn it into regular text?
Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.
s = urllib2. quote(s) # URL encode. # Now "s" is encoded the way you need it. It works!
in python2
>>> import urlparse
>>> urlparse.unquote('It%27s%20me%21')
"It's me!"
In python3
>>> import urllib.parse
>>> urllib.parse.unquote('It%27s%20me%21')
"It's me!"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With