Is there any way in python to transfrom this-> %CE%B1%CE%BB%20 into this: "αλ " which is its real representation?
Thanks in advance!
Is there any way in python to transfrom this-> %CE%B1%CE%BB%20 into this: "αλ " which is its real representation?
Thanks in advance!
There are two encodings in play here. Your string has first been encoded as UTF-8, then each byte has been percent-encoded.
To get the original string back you need to first unquote it, and then decode it:
Note that you need a Unicode enabled console in order to display the value (if you get an error with the print statement, try running it in IDLE).
python 3 answer
source
For python 2:
For python 3:
And here's code that works in all versions: