Hi all,
I'm having problems getting UTF-8 output from ncurses on the Mac OS X
Terminal. Vim (using "set encoding=utf-8") and direct output to the
terminal work, so I guess the terminal is up correctly (I've set LC_ALL
to en_US.UTF-8). I've compiled my own ncurses so that I can be sure
it's been compiled with the --enable-widec option.
Currently I'm trying around with the following snippet (in which
<c3><84> represent the associated hex codes):
#include <ncursesw/ncurses.h>
int main(int argc, char *argv[])
{
initscr();
addstr("<c3><84>");
refresh();
getch();
endwin();
return 0;
}
Simply outputting the raw .c text file to the terminal via "cat" gives
the correct output in the "addstr" line: an A-umlaut "Ä". Compiling it
via
gcc -I $MY_NCURSES_DIR/include utf8test.c -L$MY_NCURSES_DIR/lib
-lncursesw
works without any error, but running the resulting code only results in
a "?~D" output (two charachters, without the quotes). As far as I've
understood the ncurses-docs, UTF-8 output is supposed to work using the
normal output routines, and the special wide routines like "addwstr"
are only required for wchar_t types.
I guess I'm doing something very simple wrong here, but I just have no
idea what. Maybe someone's got an idea?
Thanks in advance,
Christoph.
>> Stay informed about: Terminal UTF-8 output via ncursesw