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.
RIP an inspiration; A true Folk's Guy

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