How to decoding a file handle?

Discussion in 'Perl Misc' started by happierbee, Apr 10, 2007.

  1. happierbee

    happierbee Guest

    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!
     
    happierbee, Apr 10, 2007
    #1
    1. Advertising

  2. On 2007-04-10 05:02, happierbee <> wrote:
    > 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

    --
    _ | Peter J. Holzer | I know I'd be respectful of a pirate
    |_|_) | Sysadmin WSR | with an emu on his shoulder.
    | | | |
    __/ | http://www.hjp.at/ | -- Sam in "Freefall"
     
    Peter J. Holzer, Apr 14, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    650
    Joe Smith
    Jul 22, 2004
  2. Leon
    Replies:
    2
    Views:
    537
  3. =?ISO-8859-1?Q?KLEIN_St=E9phane?=
    Replies:
    3
    Views:
    454
    hanumizzle
    Oct 6, 2006
  4. pkirk25

    Decoding a 30 MB formatted text file

    pkirk25, Sep 29, 2006, in forum: C Programming
    Replies:
    7
    Views:
    342
    Mabden
    Oct 1, 2006
  5. Replies:
    2
    Views:
    181
    Egbert Nierop \(MVP for IIS\)
    Aug 18, 2005
Loading...

Share This Page