in reply to Encodings not latching onto STDIN

Not necessarily anything to do with STDIN/STDOUT, this goes through double encoding and no decoding as well:

open(INPUT, "<input"); open my($in), "<&:encoding(japhy)", "INPUT" or die $!; open my($out), ">&:encoding(japhy)", "STDOUT" or die $!; print $out $_ while <$in>; close(INPUT);

The output is:

> < abc
> < def

Update: Confirmed that it works fine if you call binmode afterwards. It looks like this bug: http://rt.perl.org/rt3/Ticket/Display.html?id=34595

Replies are listed 'Best First'.
Re^2: Encodings not latching onto STDIN
by converter (Priest) on Feb 26, 2006 at 11:30 UTC