use locale; use strict; open ( IN, "<", "texte-latin9.txt" ) or die "Problème ouverture de fichier : ", $!, "\n"; binmode ( IN, ":encoding(latin9)" ); binmode ( STDOUT, ":encoding(cp850)" ); while ( my $ligne = ){ chomp $ligne; while ( $ligne=~ /(\pL*[\x{0152}\x{0153}]\pL*)/g ){ my $mot = $1; $mot =~s /\x{0152}/OE/g; $mot =~s /\x{0153}/oe/g; print $mot, "\n"; } } close IN;