snoopy20 has asked for the wisdom of the Perl Monks concerning the following question:
This is driving me nuts. I have a form with special characters like a pound or euro sign. It's URIencoded and Perl receives it into a variable, so for the pound sign:
%C2%A3
Note that %C2 is actually not needed I don't know why it's included. Anyway, I then run the usual on it:
$f =~ s/%([a-fA-F0-9]{2})/pack('C', hex($1))/eg;
Which gives octals..
\xc2\xa3
But how do I get this back to the pound sign?
I have tried everything and google searching for two hours. It should be simple!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: UTF8 URI Escaping
by Eliya (Vicar) on Apr 11, 2012 at 11:24 UTC | |
Re: UTF8 URI Escaping
by moritz (Cardinal) on Apr 11, 2012 at 11:26 UTC | |
by snoopy20 (Novice) on Apr 11, 2012 at 18:02 UTC | |
by Eliya (Vicar) on Apr 11, 2012 at 18:54 UTC | |
Re: UTF8 URI Escaping
by Corion (Patriarch) on Apr 11, 2012 at 11:16 UTC | |
Re: UTF8 URI Escaping
by Your Mother (Archbishop) on Apr 11, 2012 at 20:52 UTC | |
by Eliya (Vicar) on Apr 12, 2012 at 03:31 UTC | |
by Your Mother (Archbishop) on Apr 12, 2012 at 03:59 UTC | |
by snoopy20 (Novice) on Apr 12, 2012 at 07:07 UTC | |
Re: UTF8 URI Escaping
by Anonymous Monk on Apr 11, 2012 at 11:25 UTC | |
Re: UTF8 URI Escaping
by Khen1950fx (Canon) on Apr 11, 2012 at 18:08 UTC | |
Re: UTF8 URI Escaping
by ajinkyagadewar (Novice) on Apr 12, 2012 at 08:48 UTC | |
by ajinkyagadewar (Novice) on Apr 12, 2012 at 10:17 UTC | |
by snoopy20 (Novice) on Apr 12, 2012 at 11:33 UTC | |
by ajinkyagadewar (Novice) on Apr 12, 2012 at 13:31 UTC | |
by Anonymous Monk on Oct 02, 2012 at 14:59 UTC | |
by snoopy20 (Novice) on Apr 12, 2012 at 09:21 UTC | |
Re: UTF8 URI Escaping
by ajinkyagadewar (Novice) on Apr 12, 2012 at 13:33 UTC | |
by snoopy20 (Novice) on Apr 12, 2012 at 14:06 UTC | |
by snoopy20 (Novice) on Feb 04, 2013 at 07:58 UTC | |
by Anonymous Monk on Feb 04, 2013 at 08:19 UTC |
Back to
Seekers of Perl Wisdom