Decoding We can use urllib module to do this. This is in Python 2.7x — and Python 3+ (added). #!/usr/bin/env python2 """urllib module - Python 2.7x""" import urllib # ENCODED STRING THE_ENCODED_STRING = "https%3A%2F%2Flalala.com%2Flalala%3Fla%3Dla%26lala%3Dlala" # DECODED STRING THE_DECODED_STRING = urllib.unquote(THE_ENCODED_STRING) print(THE_DECODED_STRING) # OUTPUT https://lalala.com/lalala?la=la&lala=lala ➡️ Documentation for urllib.unquote() Python 2 utility . """ Python 3+ """ import urllib.parse # ENCODED STRING THE_ENCODED_STRING = "https%3A%2F%2Flalala.com%2Flalala%3Fla%3Dla%26lala%3Dlala" # DECODED STRING THE_DECODED_STRING = urllib.parse.unquote(THE_ENCODED_STRING) print(THE_DECODED_STRING) # OUTPUT https://lalala.com/lalala?la=la&lala=lala ➡️ Documentation for urllib.parse.unquote() Python 3 utility . Encoding The opposite of that function is url...
Reflections on ECMAScript (JavaScript), CSS, HTML, Blogger, technical fixes, literature, music, cinema, entertainment in general, the English language, mathematics, history, trousers-related, and curiosities of the realm.