Created
November 27, 2013 15:59
-
-
Save deibit/7678098 to your computer and use it in GitHub Desktop.
snippet for decode %20 kind URL characters, accept input from stdin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
for line in sys.stdin.readlines(): | |
r = re.findall("(%\d.)", line) | |
for i in set(r): | |
line = line.replace(i, chr(int(i.replace("%",""),16))) | |
print line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment