Apparently, the hex value of an encoded character must be at least 2
digits wide.
Found, explained and fix provided by Baptiste Daroussin. Thanks!
+grml-etc-core (0.3.61) unstable; urgency=low
+
+ * zshrc: Fix a bug in urlencode(), thanks to Baptiste Daroussin
+ [Closes: issue583]
+
+ -- Frank Terbeck <ft@grml.org> Fri, 05 Dec 2008 18:48:45 +0100
+
grml-etc-core (0.3.60) unstable; urgency=low
* zshrc: add alias http for running "python -m SimpleHTTPServer"
urlencode() {
setopt localoptions extendedglob
input=( ${(s::)1} )
- print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%$(([##16]#match))}
+ print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%${(l:2::0:)$(([##16]#match))}}
}
#f5# Install x-lite (VoIP software)