A quick question for a change.
Perl:
$string =~ s/[áàâã]/a/gi; #This line always prepends an "a"
$string =~ s/[éèêë]/e/gi;
$string =~ s/[úùûü]/u/gi;
This Regex should convert "été" into "ete". What it does instead is converting it to "aetae". In other words, it prepends an "a" to every matched element. Even "à" is converted to "aa".
If I change the first line to this
$string =~ s/(á|à|â|ã)/a/gi;
it works, but... now it prepends an e to every matched element (like "eetee").
Even though I found a suitable solution, I am still curious as to why it behaves that way. Any ideas?
Edit 1:
I added "use utf8;" but it did not change the behavior (although it broke my output in Javascript/AJAX).
Edit2:
The Stream originates from an AJAX Request, performed by jQuery. The site it originates from is set to utf8