View Single Post

Re: How to decode JavaScript's encodeURIComponent in Perl.
  #4 (permalink)  
Old 01-23-2007, 02:38 AM
John Bokma
 
Posts: n/a
Default Re: How to decode JavaScript's encodeURIComponent in Perl.

"Cloink" <Cloink_Friggson@ntlworld.com> wrote:

> $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;


s/%([0-9a-f]{2}/ chr hex $1 /egi;

Probably better to use URI::Escape.

--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
Reply With Quote