[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
add_wch() prints garbage
From: |
Igor Liferenko |
Subject: |
add_wch() prints garbage |
Date: |
Tue, 11 Apr 2017 10:07:09 +0700 |
Hi all
I compile the following program with
gcc ncurses-test.c -o ncurses-test -lncursesw -D_XOPEN_SOURCE=600
Compilation succeeds without producing any warnings. But when I run
the binary, it prints garbage, not the character `Ñ'.
Interesting fact: the output changes if we change gnome-terminal's
window size.
My setup is: Debian 9 "stretch", UTF-8 environment, gnome-terminal.
Regards,
Igor
#include <ncursesw/curses.h>
#include <wchar.h>
#include <locale.h>
int main(void)
{
setlocale(LC_CTYPE, "C.UTF-8");
initscr();
wchar_t c = L'Ñ';
add_wch((cchar_t *)&c);
refresh();
getch();
endwin();
return 0;
}
- add_wch() prints garbage,
Igor Liferenko <=