use strict; use warnings; use open ':std', ':locale'; my $file = shift; my $enc = "UTF-16"; open(my $fh, "<:encoding($enc)", $file) || die("Can't: $!"); while ( <$fh> ) { print; }