Today, I will show a source code with ncurses that show you extended characters. Run the executable into your tty not on the terminal, because you don’t see all of these characters.
Let’s see the source code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #include <ncurses.h> int main(void) { int counter, counter2=0; initscr(); curs_set(0); attron(A_UNDERLINE); mvprintw(0,24,"NCURSES ALTCHARSET CHARACTERS\n"); attroff(A_UNDERLINE); for (counter=43; counter < 256; counter++) { printw("%3d = ", counter); addch(counter | A_ALTCHARSET); if (counter2 < 7) { addch(' '); addch(ACS_VLINE); printw(" "); } counter2++; if (counter2 > 7) { addch('\n'); counter2=0; } switch (counter) { case 46: counter=47; break; case 48: counter=95; break; case 97: counter=101; break; case 126: counter=127; break; case 128: counter=160; break; case 172: counter=173; } } getch(); endwin(); return 0; } |
I