http://www.perlmonks.org?node_id=1051471


in reply to Re: Unaccenting characters
in thread Unaccenting characters

     Depending on how your file is really encoded, the tr/// function might be much easier to use and probably faster. Something like this (to be completed):

     $str =~ tr/âàäçéèêë/aaaceeee/;

I originally used the tr function like you suggested. Why it didn't work so well, I'm not sure. I had:

$_ =~ tr/àáâãäçèéêëìíîïñòóôõöùúûüý/aaaaaceeeeiiiinooooouuuuy/;
but it produced a two character result, similar to the ?? in my original question above. However, the first output character was an 'a' regardless of what the result was supposed to be, and then an unprintable character placeholder which i can't duplicate here. Like the above code, it recognized which character to replace, but then didn't do it right.

Thanks for the tip on German/Scandanavian etc languages where they don't translate 1:1, although I'm not so worried about that, at least not at the moment. :)