How can I render percent encoding in command line?
问题 I often have a string "percent encoded", such as %D1%84%D0%B0%D0%B9%D0%BB , which, if it's part of a link, a modern browser would properly render as файл . I wonder: is there a simple way to "render" a text file with percent encoding (or simply an input string in percent encoding) as the one above by using sed or other command line tool? See also this related question. 回答1: Python can do this using urllib.unquote_plus : #!/usr/bin/env python2 import sys import urllib print urllib.unquote_plus