in reply to UTF8 URI Escaping
The two octet sequence c2 a3 is the UTF-8 encoding of the pound character, so for Perl to treat it as one single character, you need to decode it:
use Encode; my $f = "%C2%A3"; $f =~ s/%([a-fA-F0-9]{2})/pack('C', hex($1))/eg; my $decoded = decode("UTF-8", $f);
And then, depending on what you want to do with the decoded string on the output side, you might want to encode it again — usually done via setting the appropriate PerlIO encoding layer for the respective file handle.
|
---|
In Section
Seekers of Perl Wisdom