Do you know where your variables are? | |
PerlMonks |
Re^2: UTF8 URI Escapingby Eliya (Vicar) |
on Apr 12, 2012 at 03:31 UTC ( [id://964688]=note: print w/replies, xml ) | Need Help?? |
...would have saved you all that lost time and plenty more in the future. Don't overestimate what some modules do :) URI::Escape::uri_unescape() does exactly the same substitution the OP posted, i.e. it also has exactly the same issues. For one, it doesn't decode the UTF-8 encoded string into a single Unicode character. Rather, it just returns the two octets \xc2 \xa3 (which the OP seems to have some problem with...). In other words, your sample would only work with a UTF-8 capable terminal, which is rendering the glyph '£' when it receives the two bytes c2 a3.
And, as Devel::Peek::Dump shows, the returned string isn't decoded (a Perl Unicode string):
This is exactly the same result the OP had achieved with his original code.
In Section
Seekers of Perl Wisdom
|
|