Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
rfc2396 url encoding
- X-seq: zsh-users 9652
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: rfc2396 url encoding
- Date: Sun, 6 Nov 2005 13:57:13 -0500
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Anyone have a way of doing this better?
urlencode() {
local input=${1} i j
for i in {1..${#input}}
do
j=$input[i]
if [[ $j == [A-Za-z0-9_.!~*\'\(\)-] ]]
then
print -n $j
else
print -n \%$(( [##16]#j))
fi
done
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author