:raw:perlio:encoding(UTF-16LE):crlf
[download]
####
:raw:perlio:encoding(UTF-16LE):crlf:utf8
##
##
$ hd Input.txt
00000000 ff fe e4 00 62 00 63 00 0d 00 0a 00 |..ä.b.c.....|
##
##
#!/usr/bin/perl -w
use strict;
use Devel::Peek;
open my $input_fh,
'<:raw:perlio:encoding(UTF-16):crlf', 'Input.txt';
my $line = <$input_fh>;
chomp $line;
Dump $line;
##
##
SV = PV(0x69ae70) at 0x605000
REFCNT = 1
FLAGS = (PADBUSY,PADMY,POK,pPOK)
PV = 0x6778e0 "\303\244bc"\0
CUR = 4
LEN = 80
##
##
SV = PV(0x750cb8) at 0x777cc8
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x86a070 "\303\244bc"\0 [UTF8 "\x{e4}bc"]
CUR = 4
LEN = 80
##
##
open my $fh, '<:encoding(UTF-16LE)', ...