M. David wrote:
> Does anyone know a simple way to convert ascii text to its hex equivalent
> in perl?
>
> imode phones break up url strings in email when it encounters japanese
> characters- so if you email the string as its hex equivalent its ok.
> eg script.pl?user=%8C%9F%8E%96
This isn't ASCII text, it's Shift-JIS. This behaviour is quite correct
since URLs aren't allowed to contain characters outside some subset of
ASCII.
This substitution will URL-encode arbitrary bytes for you:
s/([^\w$-.+!*'(),])/'%'.unpack('H2',$1)/eg;
[ Did you check the archives? http://www.appelsiini.net/keitai-l/ ]
Received on Mon Apr 2 03:27:25 2001