2016-02-24 13 views
5

यह प्रिंटयूनिकोड के साथ यूनिकोड कैसे मुद्रित करें?

�~X� 

मैं कैसे यूनिकोड बजाय मिल सकती है?

#!/usr/bin/env perl6 
use v6; 
use NCurses; 

my $win = initscr; 
my Str $s = "\x[263a]"; 
printw($s); 
nc_refresh; 
while getch() < 0 {}; 
endwin; 
+0

आपकी मदद नहीं कर सकता, जब मैं 'LANG = C perl6 -e' चलाता हूं तो एनसीर्स का उपयोग करता हूं; printw ("\ x [263a]"); '' मुझे एक coredump मिलता है। – neuhaus

+0

यह सी से संबंधित है, लेकिन लोकेल और इस तरह की सेटिंग के मामले में सहायक हो सकता है: http://stackoverflow.com/questions/4703168/adding-unicode-utf8-chars-to-a-ncurses-display-in- सी – mikeyq6

उत्तर

3

मैं आपके जैसा ही प्राप्त कर रहा था - केवल लोकेल सेट करने के लिए आवश्यक है;

#!/usr/bin/env perl6 
use v6; 
use NCurses; 

use NativeCall; 
my int32 constant LC_ALL = 6;   # From locale.h 
my sub setlocale(int32, Str) returns Str is native(Str) { * } 

setlocale(LC_ALL, ""); 
my $win = initscr; 
my Str $s = "\x[263a]"; 
printw($s); 
nc_refresh; 
while getch() < 0 {}; 
endwin; 

जो मेरे चेहरे पर एक मुस्कान डालता है ... और स्क्रीन। ☺

संबंधित मुद्दे