At 2026-06-27T19:42:50+0300, Serhiy Storchaka wrote:
> On a wide build (linked against ncursesw), window.inch() and
> window.mvinch() return a wrong value for a non-ASCII character that is
> representable in the locale's 8-bit encoding (such as ISO-8859-15 or
> KOI8-U). The character comes back as the low 8 bits of the Unicode
> code point instead of the locale-encoded byte.

This fact is documented in the functions' man page.

inch(3NCURSES):

RETURN VALUE
     These functions return OK on success and ERR on failure.

     In ncurses, they return ERR if win is NULL.

     Functions prefixed with “mv” first perform cursor movement and fail
     if the position (y, x) is outside the window boundaries.

NOTES
     inch, mvinch, and mvwinch may be implemented as macros.

     These functions do not fail if the window contains cells of curses
     complex characters; that is, if they contain characters with codes
     wider than eight bits (or greater than 255 as an unsigned decimal
     integer).  They instead extract only the low‐order eight bits of
     the character code from the cell.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to