所以在shell里可以这么用,就看起来非常完美了:
urldecode ‘字符串’ | jq .
https://unix.stackexchange.com/questions/159253/decoding-url-encoding-percent-encoding
Found these Python one liners that do what you want:
1 2 3 4 5 |
$ alias urldecode='python -c "import sys, urllib as ul; \ print ul.unquote_plus(sys.argv[1])"' $ alias urlencode='python -c "import sys, urllib as ul; \ print ul.quote_plus(sys.argv[1])"' |
Example
1 2 3 4 5 |
$ urldecode 'q+werty%3D%2F%3B' q werty=/; $ urlencode 'q werty=/;' q+werty%3D%2F%3B |