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
Post a Comment