@@ -194,6 +194,16 @@ The module :mod:`!curses` defines the following functions:
194194 the curses library itself.
195195
196196
197+ .. function :: erasewchar()
198+
199+ Return the user's current erase character as a one-character string.
200+ This is the wide-character variant of :func: `erasechar `. Availability
201+ depends on building Python against a wide-character-aware version of the
202+ underlying curses library.
203+
204+ .. versionadded :: next
205+
206+
197207.. function :: filter()
198208
199209 The :func: `.filter ` routine, if used, must be called before :func: `initscr ` is
@@ -379,6 +389,16 @@ The module :mod:`!curses` defines the following functions:
379389 by the curses library itself.
380390
381391
392+ .. function :: killwchar()
393+
394+ Return the user's current line kill character as a one-character string.
395+ This is the wide-character variant of :func: `killchar `. Availability
396+ depends on building Python against a wide-character-aware version of the
397+ underlying curses library.
398+
399+ .. versionadded :: next
400+
401+
382402.. function :: longname()
383403
384404 Return a bytes object containing the terminfo long name field describing the current
@@ -690,6 +710,18 @@ The module :mod:`!curses` defines the following functions:
690710 example as ``b'^C' ``. Printing characters are left as they are.
691711
692712
713+ .. function :: wunctrl(ch)
714+
715+ Return a string which is a printable representation of the wide character *ch *.
716+ Control characters are represented as a caret followed by the character, for
717+ example as ``'^C' ``. Printing characters are left as they are. This is the
718+ wide-character variant of :func: `unctrl `, returning a :class: `str ` rather than
719+ :class: `bytes `. Availability depends on building Python against a
720+ wide-character-aware version of the underlying curses library.
721+
722+ .. versionadded :: next
723+
724+
693725.. function :: ungetch(ch)
694726
695727 Push *ch * so the next :meth: `~window.getch ` will return it.
@@ -770,12 +802,19 @@ Window objects
770802 character previously painted at that location. By default, the character
771803 position and attributes are the current settings for the window object.
772804
805+ *ch * may be a single character, optionally followed by combining
806+ characters, that together occupy one character cell.
807+
773808 .. note ::
774809
775810 Writing outside the window, subwindow, or pad raises a :exc: `curses.error `.
776811 Attempting to write to the lower-right corner of a window, subwindow,
777812 or pad will cause an exception to be raised after the character is printed.
778813
814+ .. versionchanged :: next
815+ A character may now be given as a string of a base character followed
816+ by combining characters, instead of only a single character.
817+
779818
780819.. method :: window.addnstr(str, n[, attr])
781820 window.addnstr(y, x, str, n[, attr])
@@ -834,6 +873,9 @@ Window objects
834873 * Wherever the former background character appears, it is changed to the new
835874 background character.
836875
876+ .. versionchanged :: next
877+ Wide and combining characters are now accepted.
878+
837879
838880.. method :: window.bkgdset(ch[, attr])
839881
@@ -844,6 +886,9 @@ Window objects
844886 characters. The background becomes a property of the character and moves with
845887 the character through any scrolling and insert/delete line/character operations.
846888
889+ .. versionchanged :: next
890+ Wide and combining characters are now accepted.
891+
847892
848893.. method :: window.border([ls[, rs[, ts[, bs[, tl[, tr[, bl[, br]]]]]]]])
849894
@@ -877,12 +922,20 @@ Window objects
877922 | *br * | Bottom-right corner | :const: `ACS_LRCORNER ` |
878923 +-----------+---------------------+-----------------------+
879924
925+ .. versionchanged :: next
926+ Wide and combining characters are now accepted. A single call cannot mix
927+ them with integer or byte characters.
928+
880929
881930.. method :: window.box([vertch, horch])
882931
883932 Similar to :meth: `border `, but both *ls * and *rs * are *vertch * and both *ts * and
884933 *bs * are *horch *. The default corner characters are always used by this function.
885934
935+ .. versionchanged :: next
936+ Wide and combining characters are now accepted. A single call cannot mix
937+ them with integer or byte characters.
938+
886939
887940.. method :: window.chgat(attr)
888941 window.chgat(num, attr)
@@ -951,6 +1004,9 @@ Window objects
9511004 Add character *ch * with attribute *attr *, and immediately call :meth: `refresh `
9521005 on the window.
9531006
1007+ .. versionchanged :: next
1008+ Wide and combining characters are now accepted.
1009+
9541010
9551011.. method :: window.enclose(y, x)
9561012
@@ -1038,6 +1094,20 @@ Window objects
10381094 The maximum value for *n * was increased from 1023 to 2047.
10391095
10401096
1097+ .. method :: window.get_wstr()
1098+ window.get_wstr(n)
1099+ window.get_wstr(y, x)
1100+ window.get_wstr(y, x, n)
1101+
1102+ Read a string from the user, with primitive line editing capacity.
1103+ This is the wide-character variant of :meth: `getstr `: it returns a
1104+ :class: `str ` rather than a :class: `bytes ` object, so it can return
1105+ characters that are not representable in the window's encoding.
1106+ At most *n * characters are read; *n * defaults to and cannot exceed 2047.
1107+
1108+ .. versionadded :: next
1109+
1110+
10411111.. method :: window.getyx()
10421112
10431113 Return a tuple ``(y, x) `` of current cursor position relative to the window's
@@ -1051,6 +1121,9 @@ Window objects
10511121 the character *ch * with attributes *attr *. The line stops at the right edge
10521122 of the window if fewer than *n * cells are available.
10531123
1124+ .. versionchanged :: next
1125+ Wide and combining characters are now accepted.
1126+
10541127
10551128.. method :: window.idcok(flag)
10561129
@@ -1088,6 +1161,9 @@ Window objects
10881161 cursor are shifted one position right, with the rightmost character on the
10891162 line being lost. The cursor position does not change.
10901163
1164+ .. versionchanged :: next
1165+ Wide and combining characters are now accepted.
1166+
10911167
10921168.. method :: window.insdelln(nlines)
10931169
@@ -1137,6 +1213,19 @@ Window objects
11371213 The maximum value for *n * was increased from 1023 to 2047.
11381214
11391215
1216+ .. method :: window.in_wstr([n])
1217+ window.in_wstr(y, x[, n])
1218+
1219+ Return a string of characters, extracted from the window starting at the
1220+ current cursor position, or at *y *, *x * if specified. This is the
1221+ wide-character variant of :meth: `instr `: it returns a :class: `str ` rather
1222+ than a :class: `bytes ` object, so it can return characters that are not
1223+ representable in the window's encoding. Attributes and color information
1224+ are stripped from the characters. The maximum value for *n * is 2047.
1225+
1226+ .. versionadded :: next
1227+
1228+
11401229.. method :: window.is_linetouched(line)
11411230
11421231 Return ``True `` if the specified line was modified since the last call to
@@ -1386,6 +1475,9 @@ Window objects
13861475 Display a vertical line starting at ``(y, x) `` with length *n * consisting of the
13871476 character *ch * with attributes *attr *.
13881477
1478+ .. versionchanged :: next
1479+ Wide and combining characters are now accepted.
1480+
13891481
13901482Constants
13911483---------
0 commit comments