in reply to opening accented file names

First, make sure the Perl script is saved with the right encoding (Windows-1252 (cp1252) in my case; most text editors allow you to choose the encoding, and nowadays they mostly save in UTF-8 be default; if you want to keep it in UTF-8, then "use utf8;"). Then, this works for me on Windows 7:
use Encode qw(encode decode); $outname = encode 'cp1252', "accentué.txt"; open $outfile, $outname or die "\nIncapable d'ouvrir '$outname' en lecture\n"; $contenu = <$outfile>; close $outfile; print STDOUT encode 'cp1252', "\nContenu = $contenu\n";

Replies are listed 'Best First'.
Re^2: opening accented file names
by Your Mother (Archbishop) on Jan 07, 2016 at 16:08 UTC

    I think that for this to be robust/correct you must still need use utf8; in the script. It won't change your encode statements, it just makes sure that Perl understands the original "accentué.txt."