[San-Diego-pm] accents

Douglas Wilson dgwilson1 at cox.net
Wed Oct 27 01:11:30 CDT 2004

Joel Fentin wrote:
> In order to do a language neutral look into $Y to see if $X is within, I 
> will probably have to knock the accents off all such characters in both 
> $X & $Y. What I am hoping is that Perl has a fell-swoop method for this.

I misunderstood the question. I thought you just wanted to see IF there
were accented, etc. characters in the string. If you want to convert
the characters to 7-bit characters, I think this'll work:
use strict;
use warnings;

use Convert::Translit;

my $str = "josé, JOSÉ, or jose. He might enter niño, NIÑO";

my $t = Convert::Translit->new('Latin2', 'ascii');
print $t->transliterate($str),"\n";
jose, JOSE, or jose. He might enter nino, NINO


More information about the San-Diego-pm mailing list