bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-ncurses] wadd_wch() operates on wrong coords for non-spacing ch


From: Bill Gray
Subject: Re: [bug-ncurses] wadd_wch() operates on wrong coords for non-spacing chars
Date: Thu, 6 Jul 2023 08:22:17 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

   Demo program of possible interest for investigating this :

https://github.com/Bill-Gray/PDCursesMod/blob/master/demos/widetest.c

   You'll see,  at line 30,  that the string

Ångstrom̧̂ Piñata Façade Æsop café Noël côte

is stored with the combining characters following the characters they're supposed to modify :

L"A\x30angstrom\x327\x302 Pin\x303" L"ata Fac\x327ade"
L" \xc6sop cafe\x301 Noe\x308l co\x302te"

So I'm convinced that ncurses is doing the right thing here. Whether it's following specifications, I don't know.

-- Bill

On 7/6/23 04:14, Dr. Werner Fink wrote:
On 2023/07/05 22:21:55 -0400, Bill Gray wrote:
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.)

Ack .. the /usr/bin/printf as well as the builtin printf of the bash do show

   áaa

that is a Combining Acute Accent which is a nonspacing mark and inherit its
characteristics from the preceding character

Werner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]