Skip to content

Commit 84bf506

Browse files
gh-153862: Suggest instr() for non-encodable characters read by inch()
A character that does not fit in a single byte has a character byte of 0 in the value returned by inch(); document reading such characters with instr(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8ee475 commit 84bf506

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Doc/library/curses.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,9 @@ Window objects
10811081
and the color pair with :func:`pair_number`.
10821082
The character byte is the locale-encoded byte of the cell's character,
10831083
consistent with :meth:`instr`.
1084+
On a wide-character build, a character that does not fit in a single byte
1085+
in the current locale has a character byte of ``0``;
1086+
use :meth:`instr` to read such characters.
10841087

10851088

10861089
.. method:: window.insch(ch[, attr])

0 commit comments

Comments
 (0)