Ho bisogno di normalizzare una stringa come "queo" e non riesco a convertire i caratteri ASCII estesi come é, á, í, ecc in versioni roman/english. Ho provato diversi metodi, ma nulla funziona finora. C'è una buona quantità di materiale su questo argomento generale ma non riesco a trovare una risposta funzionante a questo problema.Normalizzazione caratteri ASCII
Ecco il mio codice:
#transliteration solution (works great with standard chars but doesn't find the
#special ones) - I've tried looking for both \x{130} and é with the same result.
$mystring =~ tr/\\x{130}/e/;
#converting into array, then iterating through and replacing the specific char
#(same result as the above solution)
my @breakdown = split("",$mystring);
foreach (@breakdown) {
if ($_ eq "\x{130}") {
$_ = "e";
print "\nArray Output: @breakdown\n";
}
$lowercase = join("",@breakdown);
}
Soluzione meravigliosa, funziona benissimo !!! Grazie! –