|P is for Practical|
How can I safely unescape a string.by Skeeve (Vicar)
|on Sep 12, 2012 at 20:07 UTC||Need Help??|
Skeeve has asked for the
wisdom of the Perl Monks concerning the following question:
In another forum someone noticed that certain characters, like Umlauts, on OS X are printed like (e.g.) "\334" and asked how to get back the real charcter ("Ü").
My solution to this was a small perl snippet:
This seems to work fine as for example
correctly prints "Über@nüber.com".
But you might have noted the disadvantage: I'm using an "eval" and so might fall for some code injection. I also needed to escape @, $, % and :. The later because I use it as the quote-character.
Currently I have no idea how I could safely get strings like this unescaped.