bug-ncurses
[Top][All Lists]
Advanced

[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: Sat, 24 Sep 2005 05:14:28 -0400 (EDT)

On Sat, 24 Sep 2005, amores perros wrote:




Myself asking another probably very simple question.

I installed libncursesw5-dev, and changed my test program
by including ncursesw
#include <ncursesw/curses.h>

and linking to ncursesw
gcc ct.c -lncursesw

and it worked this time (that is, both lowercase and uppercase
characters in my simple test program came out correctly).

I did not add code to convert my string to wchar_t,
and change my calls to call widechar (cchar) versions.

I did not define _XOPEN_CURSES.

hmm - I think you meant _XOPEN_SOURCE_EXTENDED

If your application is simple enough, it works without that.
There are a few places where the difference between cchar_t and chtype
is exposed in curses.h (the WINDOW struct for example).  As long as
you use things like addstr() and printw(), it does not matter.

This is a difference between libncurses and libncursesw: the functions
that accept a char* string expect a multibyte character string (for example UTF-8) rather than 8-bit characters.


Did I get lucky (and I should go back and define _XOPEN_CURSES,
and ignore this flaky result), or should this have worked?

As I recall your example, it should work.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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