How to decoding a file handle?

H

happierbee

Hello,
I am planning to write a hexlize program that can handle multiple
encodings. A problem is that I want use function `read' to read seveal
characters after decoding. If input is a file, function `open' can use
encoding in module Encode to decode the input file. But is input is a
file handle, STDIN, how to decode it if I don't want to decode it line
by line? More important, utf-16 can't decode line by line.
Thank you for advice!
 
P

Peter J. Holzer

If input is a file, function `open' can use encoding in module Encode
to decode the input file. But is input is a file handle, STDIN, how to
decode it if I don't want to decode it line by line? More important,
utf-16 can't decode line by line.

perldoc -f binmode

hp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top