Skip to content

Instantly share code, notes, and snippets.

@zh4n7wm
Last active October 30, 2017 08:33
Show Gist options
  • Save zh4n7wm/590fad5264204787ff81a0cafbcace41 to your computer and use it in GitHub Desktop.
Save zh4n7wm/590fad5264204787ff81a0cafbcace41 to your computer and use it in GitHub Desktop.
URI encode and decode in command line
alias urldecode='python3 -c "import sys; from urllib.parse import unquote_plus as up; print(up(sys.argv[1],encoding=\"utf-8\" if len(sys.argv)<=2 else sys.argv[2]))"'
alias urlencode='python3 -c "import sys; from urllib.parse import quote_plus as qp; print(qp(sys.argv[1],encoding=\"utf-8\" if len(sys.argv)<=2 else sys.argv[2]))"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment