in reply to Re: Perl seems to mistreat "PerlIO" environment variable (Windows)
in thread Perl seems to mistreat "PerlIO" environment variable (Windows)

Is there any way you can avoid that environment variable being set and only use binmode?

Yes, sure, it's just that it's distribution of App::* variety, end-user targeted, like "no serviceable parts inside", etc. Of course I can fix it (and should notify the author). Thanks for reminding about crlf being "alternative buffering" and therefore operating on raw bytes:

open my $fh, '>', 'tmp.txt'; binmode $fh, ':encoding(UTF16)'; print $fh qq(\N{U+010A}\n); close $fh;

output is invalid on Windows (fe ff 01 0d 0a 00 0d 0a). Should have used ':raw:encoding(UTF16)'. Oh, as I see prepending ':raw' regardless is a good practice since long ago, should have paid closer attention to such details.