perl -pe 's/A/ā/' <<< "avatAr"
gives me avatār
as expected.
But both perl -pe 'y/A/ā/' <<< "avatAr"
and perl -pe 'tr/A/ā/' <<< "avatAr"
give me avat�r
.
Why is this so? And how might I get the same results as the substitution?
I also tried perl -Mutf8 -C24 -pe 'tr/A/ā/' <<< "avatAr"
and it gave me
Wide character in print at -e line 1, <> line 1.
avatār
What am I doing wrong to get this warning? Identical results for y
instead of tr
.