I see a problem with testing
$ perl -le " binmode STDERR, q!:encoding(UTF-16le)!; print join q! !,
+PerlIO::get_layers( STDERR , details => 1)
unix 18895360 crlf 13193728 encoding UTF-16LE 13144576
$ perl -le " print join q! !, PerlIO::get_layers( STDERR , details =>
+ 1)
unix 18895360 crlf 13193728
$ perl -le " binmode STDERR; print join q! !, PerlIO::get_layers( ST
+DERR , details => 1)
unix 18895360 crlf 13177344
$ perl -le " binmode STDERR, q!:encoding(UTF-16le)!; print join q! !
+, PerlIO::get_layers( STDERR , details => 1)
unix 18895360 crlf 13193728 encoding UTF-16LE 13144576
$ perl -le " binmode STDERR, q!:raw:perlio:encoding(UTF-16le):crlf!;
+ print join q! !, PerlIO::get_layers( STDERR , details => 1)
unix 18895360 crlf 13193728 perlio 13111808 encoding UTF-16LE 13144
+576
$
So there is a bug somewhere