如何用NCurses打印Unicode?

sid*_*com 5 unicode encoding ncurses perl6

这打印

?~X?
Run Code Online (Sandbox Code Playgroud)

我怎么能得到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;
Run Code Online (Sandbox Code Playgroud)

Mar*_*rty 4

我得到了和你一样的结果 - 结果只需要设置区域设置;

\n\n
#!/usr/bin/env perl6\nuse v6;\nuse NCurses;\n\nuse NativeCall;\nmy int32 constant LC_ALL = 6;          # From locale.h\nmy sub setlocale(int32, Str) returns Str is native(Str) { * }\n\nsetlocale(LC_ALL, "");\nmy $win = initscr;\nmy Str $s = "\\x[263a]";\nprintw( $s );\nnc_refresh;\nwhile getch() < 0 {};\nendwin;\n
Run Code Online (Sandbox Code Playgroud)\n\n

这让我的脸上……和屏幕上都露出了微笑。\xe2\x98\xba

\n