URL decoding: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 303: | Line 303: | ||
<pre> |
<pre> |
||
http%3A%2F%2Ffoo%20bar%2F |
http%3A%2F%2Ffoo%20bar%2F |
||
http://foo bar/ |
|||
</pre> |
|||
<lang awk> |
|||
LC_ALL=C |
|||
echo "http%3A%2F%2Ffoo%20bar%2F" | gawk -vRS='%[[:xdigit:]]{2}' ' |
|||
RT {RT = sprintf("%c",strtonum("0x" substr(RT, 2)))} |
|||
{gsub(/+/," ");printf "%s", $0 RT}' |
|||
</lang> |
|||
{{out}} |
|||
<pre> |
|||
http://foo bar/ |
http://foo bar/ |
||
</pre> |
</pre> |