On Sat, 27 Sep 2008, Juan Céspedes wrote:
On Sat, Sep 27, 2008 at 1:21 AM, Thomas Dickey <[EMAIL PROTECTED]> wrote:
Two observations:
It does not initialize locale.
#include <locale.h>
setlocale(LC_ALL, "");
Nice. Including these lines it does work. Why is it necessary to
initialize locale? I am tempted to rename the bug :)
Without initializing the locale, ncurses doesn't know about UTF-8.
It's an encoding that can use multiple bytes per character.
Technically it should only honor POSIX locale (7-bits) when locale is not
initialized, but ten years ago, I was persuaded that locale support wasn't
that uniform - so when no locale is set, ncurses will go beyond that into
an 8-bit legacy mode (essentially ISO-8859-1). Both POSIX and ISO-8859-1
use only one byte per character.
mvaddstr(1, 1, "Juan Cespedes");
mvaddstr(2, 1, "Juan Céspedes");
The string is encoded for ISO-8859-1 (not UTF-8).
Oops, it must have been due to some copy & paste; the file I tried was
UTF-8 encoded.
Thanks,
no problem (report bugs)
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net