Re: Is there a better way to convert foreign characters?

Dr.Ruud wrote:

perl -Mstrict -Mutf8 -MText::Unidecode -wle '
my $s = "àâÀéèëêÉÊçÇîïôÔùû";
print Text::Unidecode::unidecode( $s );

The purpose of that module is to handle non-Roman characters. What makes you believe those characters are Unicode?

$ perl -MEncode -le '
$octets = "àâÀéèëêÉÊçÇîïôÔùû";
print "Raw: ", $octets;
print "Latin-1: ", decode "ISO-8859-1", $octets;
print "ANSI: ", decode "Windows-1252", $octets;
Raw: àâÀéèëêÉÊçÇîïôÔùû
Latin-1: àâÀéèëêÉÊçÇîïôÔùû
ANSI: àâÀéèëêÉÊçÇîïôÔùû

Gunnar Hjalmarsson