Skip to content

Instantly share code, notes, and snippets.

@deibit
Created November 27, 2013 15:59
Show Gist options
  • Save deibit/7678098 to your computer and use it in GitHub Desktop.
Save deibit/7678098 to your computer and use it in GitHub Desktop.
snippet for decode %20 kind URL characters, accept input from stdin
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