Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Encodings not latching onto STDIN

by alexz (Beadle)
on Feb 24, 2006 at 20:29 UTC ( #532658=note: print w/ replies, xml ) Need Help??


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


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://532658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-07-29 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls