Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Nov 17, 2010 at 07:50 UTC ( [id://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.

Replies are listed 'Best First'.
Re^2: Printing Unicode on the Windows Console and the importance of of i/o layers
by nikosv (Deacon) on Nov 17, 2010 at 08:57 UTC
    yep,good observation

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-28 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found