Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
P is for Practical
 
PerlMonks  

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

by nikosv (Hermit)
on Nov 17, 2010 at 07:23 UTC ( #871945=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #unicode_box_incorrect.pl
    use Win32::API;
    ...
    
    print "THIS IS THE INCORRECT EXAMPLE OUTPUT: \n";
    print $unicode_string;
    
  2. or download this
    #unicode_box_correct.pl
    use Win32::API;
    ...
    #use WriteFile API to treat the Console as a file.WriteConsole won't d
    +o it
    $WriteFile=new Win32::API( 'kernel32.dll', 'WriteFile', 'NPNNN', 'N' )
    +;
    $WriteFile->Call($handle,$unicode_string, $lengthx,0,0);
    
  3. or download this
    #unicode_box_correct_pure_perl.pl
    use Win32::API;
    ...
    print "THIS IS THE CORRECT EXAMPLE OUTPUT IN PURE PERL: \n";
    print $unicode_string;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://871945]
Approved by McDarren
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-04-20 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls