Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Encode: unable to change encoding of strings

by ioannis (Vicar)
on Jul 09, 2006 at 02:20 UTC ( #559967=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-30 08:25 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 (270 votes), past polls