i\'m currently working on a C++ project in which I need to display some extended characters (wchar_t).
The main problem is that, even if it works fine in C (using
You need to setlocale(LC_ALL, "") before doing initscr().
setlocale(LC_ALL, "")
initscr()
A working example:
#include <ncursesw/ncurses.h> #include <locale.h> #include <wchar.h> int main() { setlocale(LC_ALL, ""); initscr(); wchar_t wstr[] = { 9474, L'\0' }; mvaddwstr(0, 0, wstr); refresh(); getch(); endwin(); return 0; }