[Top][All Lists]

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

ncurses 5.4, en_US.UTF-8, lowercase ok but uppercase garbled (non-ASCII)

From: amores perros
Subject: ncurses 5.4, en_US.UTF-8, lowercase ok but uppercase garbled (non-ASCII)
Date: Thu, 22 Sep 2005 02:28:52 +0000


Doing UTF-8 output with ncurses 5.4 on debian, I see lowercase
a acute and ennay come out ok, but uppercase ones are scrambled
(open box characters and other stuff). I'm using locale

I'm programmer & user, so I may be missing something on either
front, and am soliciting suggestions or pointers.


I am both user and programmer, and am using debian linux, with
libncurses 5.4. I'm using ncurses calls (not ncursesw, which I've
only just seen some references to on the web).

I'm seeing some (non-ASCII) letters come out as boxes, and some come out ok.
Lowercase acute a and lower case ennay show up ok, but the uppercase ones
come out as funny boxes and symbols.

The UTF-8 byte codes involved are, as I recall, c3 81, c3 91, c3 a1, and c3 b1.
I added some logging of hex values, and found that I am passing these values
correctly in my calls to ncurses (mvwaddstr -- or something, I don't actually
recall very well).

I wrote a test.c program which just outputed those bytes to stdout via
printf, and they come out ok then (both lower and upper case a acute and
lower and upper case ennay).

My locale is en_US.UTF-8, and when I execute the locale command, it seems
like everything is set to that (LC_ALL and a bunch of other LC things).

When I check the Terminal settings of the little terminal window, it says
encoding is UTF-8 (I confess my ignorance; I don't even know if it is an
xterm that I'm using, but "which xterm"  and "whereis xterm" give me no
hits, which surprised me).

I'm in an x windowing system, but haven't figured out which one yet.

I'm really hoping there is a way to do this without using libncursesw,
because that sounds like another api to ncurses which may not be
present on as many boxes. Also, I was really hoping that things would
work out the most easily in the case of using UTF-8 internally and
for display as well (my program does convert from internal
encoding to display, but I'm working on this display bug
when both internal and display are UTF-8, on linux, with

I found an article on this list's archive


which suggests that I find & read these references:

I've been adding to the test programs in ncurses to demonstrate these
and other functions.  test/view.c and test/ncurses.c for example.

so I plan to do that.



reply via email to

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