[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] URL encoding



I'm trying to do URL encoding in a script, just like the browser does
when it sends a query.
I'm using :
        $newchar='%'.hex(unpack("C",$char));
to encode (which is not correct).
I tried just hex($char) but that isn't right either.

I use:
        s/%(\w\w)/chr(hex($1))/
to decode (which I think is correct)

What is the correct encoding statement?  Also, do you know where I can
find a list of what characters need to be encoded, besides & and %?
--


-->John Springer
        Still the Penultimate Mac bigot.
        <http://www.digitalmx.com>