#include #include #include // gcc -I/usr/include/ncursesw/ -D_XOPEN_SOURCE_EXTENDED inwstr_test.c -lncursesw int main() { // WINDOW *win1, *win2; int ret; // cchar_t cc1, cc2; wchar_t wc[12+1]; int i; setlocale(LC_ALL,""); initscr(); cbreak(); noecho(); halfdelay(100); //display value of constants /* printw("FALSE %d\n", FALSE ); printw("TRUE %d\n", TRUE ); printw("false %d\n", false ); printw("true %d\n", true ); printw("OK %d\n", OK ); printw("ERR %d\n", ERR ); */ //display size printw("%s\n", "これはcurs_inwstr確認用プログラムです" ); printw("sizeof(wchar_t) %d\n", sizeof(wchar_t) ); printw("%s\n", "กรุงเทพมหานคร" ); printw("%s\n", "สักกะทัตติยวิษณุกรรมประสิทธิ์" ); //get string ret = mvinnwstr(0,0,wc,12); //put result move(6,0); printw("mvinnwstr(0,0,wc,12) = %d\n", ret ); addwstr(wc); addch('\n'); ret = mvinnwstr(3,0,wc,12); move(8,0); printw("mvinnwstr(2,0,wc,12) = %d\n", ret ); addwstr(wc); addch('\n'); for (i=0; i<=12; ++i) printw("%04x\n", wc[i] ); refresh(); getch(); endwin(); return(0); }