我需要打印一些Unicode字符爲我的遊戲終端,有的像這樣,\U0001F0A1
,和我的代碼打印長的Unicode中的ncurses
#include <curses.h>
#include <locale.h>
int main(){
setlocale(LC_ALL, "");
initscr();
printw("\U0001F0A1");
getch();
endwin();
return 0;
}
和所有它打印出來是黑屏,但是當我試圖使用printf,它可以正常打印卡片。
試試'setlocale(LC_ALL,「en_US.UTF-8」);' –
也''printw(L「\ U0001F0A1」);' –
http://stackoverflow.com/questions/4703168/adding-unicode-utf8 -chars-to-a-ncurses-display-in-c – Boiethios