On Win32 the :crlf layer is special - it replaces the use of the normal
:perlio buffering layer.
So while binmode :raw with :crlf present on non-Win32 removes the
CRLF layer, on Win32 it simply switches the :crlf layer's CRLF flag off
to prevent translation.
Unfortunately the :crlf skipped doing something else expected by :raw -
it didn't turn off the layer UTF8 flag. This broke the tests I added
in
9704d779004.
PerlIO_pop(aTHX_ f);
#endif
}
- return 0;
+ return PerlIOBase_binmode(aTHX_ f);
}
PERLIO_FUNCS_DECL(PerlIO_crlf) = {
ok((() = grep($_ eq "utf8", PerlIO::get_layers($fh))),
"check :utf8 set");
ok(binmode($fh), "remove :utf8");
- local $TODO = "this fails without the fix";
ok(!(() = grep($_ eq "utf8", PerlIO::get_layers($fh))),
"check :utf8 removed");
close $fh;
# separate to avoid interfering with the data expected above
$local or skip("No localhost", 1);
$fork or skip("No fork", 1);
- $^O eq "MSWin32"
- and skip("binmode acting strangely here on Win32", 1);
note "recv/send :utf8 tests";
ok(socket(my $serv, PF_INET, SOCK_STREAM, $tcp), "make a tcp socket (recv/send :utf8 handling)");