How to convert the U+XXXXX sequence to character in perl? -


this

perl -co -e 'say "\n{u+00e1}"' 

prints

á 

how achieve same á following:

echo "u+00e1" | perl -co -lne 'say what_here($_)' 

use charnames:

echo "u+00e1" | perl -mcharnames=short -co -lne 'say charnames::vianame($_)' 

you can use eval, if can control comes in input:

echo "u+00e1" | perl -co -lne 'say eval qq("\\n{$_}")' 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -