Re: curses inch()/mvinch() mangle non-ASCII characters of an 8-bit locale on a wide build
"G. Branden Robinson" <[email protected]> Tue, 30 Jun 2026 12:11:32 -0500
| Newsgroups | gmane.comp.lib.ncurses.bugs |
|---|---|
| Message-ID | <20260630171132.e7ej3hceucodyrfv@illithid> |
--occ2rvffavg5cach
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: curses inch()/mvinch() mangle non-ASCII characters of an 8-bit
locale on a wide build
MIME-Version: 1.0
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 =E2=80=9Cmv=E2=80=9D first perform cursor move=
ment 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=E2=80=90order eight bits =
of
the character code from the cell.
Regards,
Branden
--occ2rvffavg5cach
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmpD+L0ACgkQ0Z6cfXEm
bc7ojQ/+KO/tz5huD8TdGeMAv5so2d492UkUa6PrT4B+9wWsWVsU58Bt3Q5af+pK
e1Pb5ft6RmHTYAAnu3WGilNQmVl5Uh8TJ02RwYpJku9W6SvyAFwTyzrvLYXiBv3o
kOCKwZ4uB6iSl/MhKwBl2Iua2Mt5Plprrzse40AVfHo3/oA6RrKFdFacWr4MmhNE
FTEgcuZU6chGnweHiOGl4pZ8w30dghGUS4ta6BIMLqyeD2AYmw9W4nl/IFGttN1i
oNbaPg7dSTR8kaHRM6AIxvAbPuBUQJSEx0Pu3+Xw90m64slDCOfpvNnkovDRdOYI
RqUy8kqKI3VOrZqv/ndTPn+9YNN2neX4akMsnMlPdBilISUjSt8AsbA3ZX1RKZYK
wvZNQO8uOOLpftTbAcPAouHmttsoocnrwzZhCC4XZhroFAYGAu3iqBfRLs/A9HZC
PRWzpW81RASN4FjNgSH1NXdpNb5SNqD3gHmq6kIn2Wx0ZhD0fp17he3wRhDWsHSO
AJCw4AYwXBDnBEl9CEBnmSAH09flSOwDgMyT6qKrOe+pJ1u/pNF4CODjO11+ehax
ErX/dQG4A11NYTeU3l/aDSNu6jgOjrtAB7eD8aUufmob0H/aL9y9HEIN6qsxbtgX
NhfEyVg4TPWPNhMqFtS5KuxrG99TmvJofY9EK1kenq3yPcCSBws=
=rLZl
-----END PGP SIGNATURE-----
--occ2rvffavg5cach--