bug-ncurses
[Top][All Lists]
Advanced

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

Re: is correct to use waddnstr for utf8 strings?


From: Pavel Stehule
Subject: Re: is correct to use waddnstr for utf8 strings?
Date: Thu, 2 May 2019 11:48:42 +0200



čt 2. 5. 2019 v 11:27 odesílatel Thomas Dickey <address@hidden> napsal:
On Wed, May 01, 2019 at 04:48:01PM +0200, Pavel Stehule wrote:
> Hi
>
> st 1. 5. 2019 v 14:39 odesílatel Pavel Stehule <address@hidden>
> napsal:
>
> > Hi
> >
> > I try to fix some issues with utf8 chars on Solaris.
...
> I wrote small test. Looks so Solaris doesn't work correctly with 3bytes
> utf8 chars. Two bytes are ok.
>
> Is it ncurses issue or Solaris issue?

I suspect Solaris (though I might find time on the weekend to investigate
this).

There's an additional factor that the package is probably rather old.

I see same behave with integrated Solaris ncurses and with OpenCSW ncurses.

OpenCSW package is relative fresh

ncurses version: 6.1, patch: 20180127
ncurses with wide char support
ncurses widechar num: 0

buildin ncursis is older

ncurses version: 6.0, patch: 20170708
ncurses with wide char support
ncurses widechar num: 0



>
> Pavel

> #include <ncursesw/curses.h>                                                   
> #include <locale.h>                                                             
> #include <string.h>                                                             
>                                                                                 
> int main()                                                                     
> {                                                                               
>         /* these strings has 30 chars display width */                         
>         char *str1 = "└────────────────────────────┴";                         

One problem with Solaris, which I worked-around a few years ago,
is that all of the line-drawing characters are "ambiguous width",
and that Solaris' locale assigns all of those to double-width.

See

https://invisible-island.net/ncurses/NEWS.html#t20151219

and subsequent mention of Solaris.

--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

reply via email to

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