
how do I retranslate escaped characters
Hi !
http (the transfer protocol of WWW) escapes difficult characters like
this: '%', followed by the character code in hex
e.g. + is encoded as %2B .
Now I've got a string $val containing zero or more such escaped characters.
How do I translate them back ?
I've tried
while($val=~/%(..)/)
{
$h=$1;
$c = pack('c', hex($h));
$val =~ s/%$h/$c/g;
};
but surely there must be a better way to do it ? (A friend told
me he saw a oneline for doing it - but he can't remember where..)
thanx in advance
Brigitte
--
Brigitte Jellinek | WWW: " http://www.*-*-*.com/ ;
Salzburg University | Help! I'm caught in the Web.