This is a follow-up of gh-151757, which added wide-character support and the curses.complexchar character-cell type.
That type cannot currently be passed to the curses.ascii functions, so code that reads a cell -- for example via curses.window.in_wch() -- and wants to classify it with curses.ascii has to unwrap it by hand first.
The membership predicates (isalpha(), isdigit(), isprint(), iscntrl(), ...) and the ctrl() and unctrl() conversions should also accept a complexchar, classifying it by its single character. A cell that holds combining characters is not a single character, so the predicates return false for it.
While there, ctrl() should be a no-op for a non-ASCII argument. There is no control character outside ASCII, and masking the code to 0x1f (as it does now) just yields an unrelated control byte.
ascii(), alt() and ismeta() remain meaningless for non-8-bit codes, a complexchar included.
Linked PRs
This is a follow-up of gh-151757, which added wide-character support and the curses.complexchar character-cell type.
That type cannot currently be passed to the curses.ascii functions, so code that reads a cell -- for example via curses.window.in_wch() -- and wants to classify it with curses.ascii has to unwrap it by hand first.
The membership predicates (isalpha(), isdigit(), isprint(), iscntrl(), ...) and the ctrl() and unctrl() conversions should also accept a complexchar, classifying it by its single character. A cell that holds combining characters is not a single character, so the predicates return false for it.
While there, ctrl() should be a no-op for a non-ASCII argument. There is no control character outside ASCII, and masking the code to 0x1f (as it does now) just yields an unrelated control byte.
ascii(), alt() and ismeta() remain meaningless for non-8-bit codes, a complexchar included.
Linked PRs