How can I encode and decode percent-encoded (URL encoded) strings on the command line?
I'm looking for a solution that can do this:
$ percent-encode "ændrük" %C3%A6ndr%C3%BCk $ percent-decode "%C3%A6ndr%C3%BCk" ændrük
These commands do what you want:
If you want to encode spaces as
I'm guessing you will want to alias them ;-)
I found a package,
Unfortunately, it does not decode stdin or a command line option, but only rename a file, so you have to create a dummy file to obtain the decoding (the name of the renamed file), but with some bash scripting the process can be automated.
No information about the encoding part, even because it could be questionable which characters to encode. Only non-ASCII?
I think there should be some better tool/method.
Using PHP you can try the following command: