Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Printing Unicode on the Windows Console and the importance of of i/o layers

by BrowserUk (Pope)
on Nov 17, 2010 at 07:50 UTC ( #871949=note: print w/ replies, xml ) Need Help??


in reply to Printing Unicode on the Windows Console and the importance of of i/o layers

Rather than messing with Win32::API (which I've never gotten to work for 64-bit), you can use Win32::Console::OutputCP(). This produces the required output:

use Win32::Console; binmode(STDOUT, ":unix:utf8"); Win32::Console::OutputCP( 65001 ); $line1 = "\x{2554}".("\x{2550}"x15)."\x{2557}\n"; $line2 = "\x{2551}".(" "x15)."\x{2551}\n"; $line3 = "\x{255A}".("\x{2550}"x15)."\x{255D}"; $unicode_string = $line1.$line2.$line3; print "THIS IS THE CORRECT EXAMPLE OUTPUT IN PURE PERL: \n"; print $unicode_string;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Printing Unicode on the Windows Console and the importance of of i/o layers
Select or Download Code
Re^2: Printing Unicode on the Windows Console and the importance of of i/o layers
by nikosv (Hermit) on Nov 17, 2010 at 08:57 UTC
    yep,good observation

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-07-04 02:37 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 (57 votes), past polls