/* * To build: * gcc -o curses curses.c -lncursesw * * Expected result: display these chars: * http://www.fileformat.info/info/unicode/char/2603/index.htm (snowman) * http://www.fileformat.info/info/unicode/char/26c4/index.htm (snowman without snow) * http://www.fileformat.info/info/unicode/char/1f638/index.htm (grinning cat face with smiling eyes) * * Looks like ncurses is NOT able to display second and third char * (only the first one is OK...) */ #include #include #include int main (int argc, char *argv[]) { WINDOW *stdscr; char buffer[] = { '<', 0xE2, 0x98, 0x83, // U+2603 : snowman: OK 0xE2, 0x9B, 0x84, // U+26C4 : snowman without snow: ERROR (space displayed) 0xF0, 0x9F, 0x98, 0xB8, // U+1F638: grinning cat face: ERROR (space displayed) '>', '\0' }; setlocale (LC_ALL, ""); stdscr = initscr (); mvwprintw (stdscr, 0, 0, buffer); getch (); endwin (); return 0; }