bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrong signal for window resize


From: Igor Liferenko
Subject: Wrong signal for window resize
Date: Thu, 20 Apr 2017 16:43:34 +0700

Hi all,

For get_wch() the same signal for window resize is
passed as for getch() - 110011010.

While for getch() it is ok, as this value is outside
of "char" type, this is wrong for wide-chars because
it is a legal codepoint value U+019A
(LATIN SMALL LETTER L WITH BAR)

The following program can be used to check this
(compile with
"gcc test.c -o test -lncursesw -D_XOPEN_SOURCE=600")

#include <ncursesw/curses.h>
#include <wchar.h>
#include <locale.h>
int main(void)
{
  setlocale(LC_CTYPE, "C.UTF-8");
  initscr();
  wint_t c;
  get_wch(&c);
  endwin();
  for (int i = sizeof(wint_t)*8-1; i >= 0; i--) {
    if (c & (wint_t)(1<<i)) wprintf(L"1"); else wprintf(L"0");
  }
  wprintf(L"\n");
  return 0;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]