Skip to content

Commit 05bc015

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 064a5ad commit 05bc015

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
@@ -1084,6 +1084,9 @@ Window objects
10841084
and the color pair with :func:`pair_number`.
10851085
The character byte is the locale-encoded byte of the cell's character,
10861086
consistent with :meth:`instr`.
1087+
On a wide-character build, a character that does not fit in a single byte
1088+
in the current locale has a character byte of ``0``;
1089+
use :meth:`instr` to read such characters.
10871090

10881091

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

0 commit comments

Comments
 (0)