如何使用 NCurses 打印 Unicode?
How to print Unicode with NCurses?
这会打印
�~X�
我怎样才能得到 unicode ☺
?
#!/usr/bin/env perl6
use v6;
use NCurses;
my $win = initscr;
my Str $s = "\x[263a]";
printw( $s );
nc_refresh;
while getch() < 0 {};
endwin;
我和你一样 - 结果只需要设置语言环境;
#!/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;
这让我的脸上……和屏幕都笑了。 ☺
这会打印
�~X�
我怎样才能得到 unicode ☺
?
#!/usr/bin/env perl6
use v6;
use NCurses;
my $win = initscr;
my Str $s = "\x[263a]";
printw( $s );
nc_refresh;
while getch() < 0 {};
endwin;
我和你一样 - 结果只需要设置语言环境;
#!/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;
这让我的脸上……和屏幕都笑了。 ☺