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; } #### use strict; use warnings; use open ':std', ':locale'; my $file = shift; my $enc = "UTF-16"; my $file = do { open(my $fh, "<:raw", $file) || die("Can't: $!"); local $/; <$fh> }; my $str = decode('UTF-16', $_); print $str;