Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Doc/howto/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ the next subsection.
The :meth:`~curses.window.addstr` method takes a Python string or
bytestring as the value to be displayed. The contents of bytestrings
are sent to the terminal as-is. Strings are encoded to bytes using
the value of the window's :attr:`~window.encoding` attribute; this defaults to
the default system encoding as returned by :func:`locale.getencoding`.
the encoding of the current locale (see :func:`locale.getencoding`).

The :meth:`~curses.window.addch` methods take a character, which can be
either a string of length 1, a bytestring of length 1, or an integer.
Expand Down
6 changes: 5 additions & 1 deletion Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,11 @@ Other

.. attribute:: window.encoding

Encoding used to encode method arguments (Unicode strings and characters).
Encoding used to encode and decode method arguments and results
(Unicode strings and characters) on a narrow build. It is not used on a
build linked against a wide-character version of the underlying curses
library, where strings are passed to curses as wide characters and the
encoding of the current locale determines the bytes.
The encoding attribute is inherited from the parent window when a subwindow
is created, for example with :meth:`window.subwin`.
By default, current locale encoding is used (see :func:`locale.getencoding`).
Expand Down
Loading