Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: rfc2396 url encoding



On Nov 6,  1:57pm, Clint Adams wrote:
}
} Anyone have a way of doing this better?

urlencode() {
    setopt localoptions extendedglob
    input=( ${(s::)1} )
    print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%$(([##16]#match))}
}



Messages sorted by: Reverse Date, Date, Thread, Author