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: Wed, 1 May 2019 16:48:01 +0200

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.

In my application https://github.com/okbob/pspg I often use waddnstr for passing utf8 strings to ncurses windows. I had not a problem to today. When I try to fix broken output on Solaris I found so there are alternative functions for wchar_t type (Unfortunately these functions doesn't work well on Solaris too). There are problem with calculation of display width of utf8 or wide chars. When chars are displayed, then are displayed correctly.

CFLAGS = -I/opt/csw/include -m64 -DCOMPILE_MENU   -D_GNU_SOURCE  -DPACKAGE_NAME=\"pspg\" -DPACKAGE_TARNAME=\"pspg\" -DPACKAGE_VERSION=\"0\" -DPACKAGE_STRING =\"pspg\ 0\" -DPACKAGE_BUGREPORT=\"address@hidden\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_NCURSESW=1 -DHAVE_CURSES=1 -DHAVE_CURSES_ENHANCED=1 -DHAVE_CURSES_COLOR=1 -DHAVE_CURSES_OBSOLETE=1 -DHAVE_NCURSESW_CURSES_H=1 -DHAVE_PANEL=1 -DHAVE_NCURSESW_PANEL_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBREADLINE=1 -DHAVE_READLINE_READLINE_H=1 -DHAVE_READLINE_HISTORY=1 -DHAVE_READLINE_HISTORY_H=1 -DHAVE_LIBM=1 -Wall

address@hidden:~/src/pspg$ ldd pspg
    libm.so.2 =>     /lib/64/libm.so.2
    libreadline.so.6 =>     /usr/lib/64/libreadline.so.6
    libpanelw.so.6 =>     /opt/csw/lib/64/libpanelw.so.6
    libncursesw.so.6 =>     /opt/csw/lib/64/libncursesw.so.6
    libc.so.1 =>     /lib/64/libc.so.1

address@hidden:~/src/pspg$ set|grep LC
LC_ALL=en_US.UTF-8
LC_COLLATE=
LC_CTYPE=
LC_MEASUREMENT=en_US.UTF-8
LC_MESSAGES=
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TIME=en_US.UTF-8
MAILCHECK=60

Regards

Pavel Stehule

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?

Pavel


 

Attachment: pokus01.c
Description: Text Data

Attachment: Snímek z 2019-05-01 16-45-24.png
Description: PNG image

Attachment: solaris - broken.png
Description: PNG image


reply via email to

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