[Top][All Lists]

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

Re: I've made a simple program, showing UTF-8 lower but not uppercase wo

From: Thomas Dickey
Subject: Re: I've made a simple program, showing UTF-8 lower but not uppercase working
Date: Fri, 23 Sep 2005 19:24:57 -0400 (EDT)

On Fri, 23 Sep 2005, amores perros wrote:

From: Thomas Dickey To: amores perros CC: mailing list
Subject: Re: I've made a simple program, showing UTF-8 lower but not uppercase working

On Fri, 23 Sep 2005, amores perros wrote:

Since my last post here, I've proceeded to isolate a test program

I read that, but it's been a busy week.
The normal libncurses.so cannot do anything useful with UTF-8.
It won't produce it, cannot read it.

It occurs to me that I could have handled the special case of Latin-1 in a UTF-8 locale, but that isn't generally useful (though I do that in the text editor vile). Something for a to-do list, e.g., to handle the various legacy code that doesn't know anything about locales. It won't be in ncurses 5.5 though.

How is that a special case? Is it because you can convert the UTF-8 back
to Latin-1 and store it in an array of 8-bit entries?

yes.  I did something like this for vile (vi-like-emacs) about a year ago.
It still relies on the application setting up its locale properly.

Since ncurses (no w) stores one 8-bit character per cell, that would work,
but it opens up a new line of development while I've been working for the past few months to close things out.

To read/write UTF-8, you need the libncursesw flavor.

I'm sorry to belabor this, but since I'm unsure, is there any way I can
make my program work on systems which have stock ncurses 5.4 installed
(as I gather many Debian systems, and perhaps others, will have)?

no. If you're running in UTF-8, there should be a corresponding libncursesw available (whether or not it's installed). I see that a package for stable is available by looking here:


I note there that "oldstable" is pre-UTF-8 both for ncurses and for the
system as a whole.

Or will I have to say, you cannot use UTF-8 unless you upgrade your
system by installing a widechar-compiled version of ncurses?

That's essentially true. Offhand I don't see a general use for the workaround (in ncurses). For vile it's useful since I'm more likely to be editing Latin-1 text (for special things such as the copyright symbol) than UTF-8.

It would be useful for the legacy stuff that doesn't have any locale support, but I've only seen comments about a couple of _those_ in the past few weeks (not on Debian though). Since it would rely on the application setting up its locale properly, it would mean that the application has been updated - in which case there's little reason for not also rebuilding against ncursesw.

Or could I ship ncurses as a subdirectory, rigged to compile
with --with-widechar? But, truthfully, I'm not nearly good enough
with autotools for this to be feasible. It is just that the way
that iconv support comes with an embedded version,  that
makes me think of it.

I suppose so (a few megabytes....)

successfully printing a UTF-8 string out via printf, but then
invoking ncurses and observing mixed results -- the lowercase
letters are ok, but the upperones are apparently trashed (I see
open boxes, and more characters than I should).

I'm still testing on ncurses5.4 from debian linux stable.

Debian/testing has a ncursesw5.4

Debian stable also does:

        has http://packages.debian.org/stable/libs/libncursesw5

In the meantime, I've gotten the ncurses5.4 source from a
gnu ftp site, and tried compiling it locally with --with-widechar,


For casual testing in the build tree, I do

        configure \
                --with-shared \
                --without-normal \
                --without-debug \
                --with-trace \

(as I suspect that I need that to get cchar_t defined)

yes, and the application must define _XOPEN_SOURCE_EXTENDED

but have immediately run into my ignorance about termcaps
and terminfo -- about which I'm sure there is much on the
Internet that I should read before asking you to hold my
hand. In any case, thank you for the pointer to the debian/testing
package, which might more easily allow me to proceed than
my figuring out how to get my own compiled version going.



Bug-ncurses mailing list

Thomas E. Dickey

reply via email to

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