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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -