On 7/5/23 19:41, Thomas Dickey wrote:
On Wed, Jul 05, 2023 at 09:51:32PM +0200, Roman Zilka wrote:
Hello,
according to curs_add_wch(3x) add_wch() adds non-spacing characters to
the base character on the current coordinates. Therefore, the
following program should print "aáa". It prints "áaa", however.
thanks - I can reproduce this, will investigate
More simply, addwstr( L"a\u0301aa"); will emit áaa, not aáa. So does
wprintf( "La\u0301aa"). I noticed this some years back and assumed it was
supposed to be that way: the combining character modifies the preceding
character. A bit of Web searching suggests that's the way it's supposed to
work; to get á, you emit a and then \u0301, not \u0301 and then a.
Seen from that angle, Roman's program is working correctly;
move(0, 1); add_wch(&ccmod);
says "add an accent to the character just to the left of (0, 1)."
However, I have to admit that the man page description, I think, supports
Roman's expected behavior.
I would find it annoying to use \u0301aaa for curses and a\u0301aa for
everything else.
Are there any implementations of curses other than ncurses and
PDCursesMod that handle combining characters? (I copied the ncurses
behavior for PDCursesMod, so that's not independent support for the ncurses
behavior.)