Urlencoding

From Kyle's Wiki
Jump to: navigation, search

If you are submitting things with wget, where the server is expecting post data to be "url-encoded". Here is a sed script to do that:

s/%/%25/g
s/\t/%09/g
s/!/%21/g
s/"/%22/g
s/#/%23/g
s/\$/%24/g
s/\&/%26/g
s/'\''/%27/g
s/(/%28/g
s/)/%29/g
s/\*/%2A/g
s/+/%2B/g
s/ /\+/g
s/,/%2C/g
#s/-/%2D/g
#s/\./%2E/g
s/\//%2F/g
s/:/%3A/g
s/;/%3B/g
s/</%3C/g
s/>/%3E/g
s/?/%3F/g
s/@/%40/g
s/\[/%5B/g
s/\\/%5C/g
s/\]/%5D/g
s/\^/%5E/g
s/_/%5F/g
s/`/%60/g
s/{/%7B/g
s/|/%7C/g
s/}/%7D/g
s/~/%7E/g
s/      /%09/g
Personal tools
Namespaces

Variants
Actions
Efforts
Toolbox
Meta