[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: |
Dr. Werner Fink |
Subject: |
Re: [bug-ncurses] wadd_wch() operates on wrong coords for non-spacing chars |
Date: |
Thu, 6 Jul 2023 10:14:03 +0200 |
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
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
signature.asc
Description: PGP signature