in reply to Encode: unable to change encoding of strings

This liner should work. But since I seat on a console terminal, I prefer avoiding changing fonts and consolechars to visually verify.

The -COE sets for utf8 output, and binmode sets the STDIN for latin1.

perl -COE -npe 'BEGIN{binmode q(:encoding(latin1))} ' < file

  • Comment on Re: Encode: unable to change encoding of strings

Replies are listed 'Best First'.
Re^2: Encode: unable to change encoding of strings
by Hue-Bond (Priest) on Jul 09, 2006 at 02:45 UTC
    The -COE sets for utf8 output

    Nice to know :^).

    However, I'm not getting data from a filehandle, but from an XML::Simple object. It's been my mistake not reflecting it clearly at the first attempt. I've updated the OP in the hope that it's better stated now.

    --
    David Serrano