24 Feb 01:40
utf-8 strings in ncursesw with c-wrapper
From: Leonardo Boiko <leoboiko <at> gmail.com>
Subject: utf-8 strings in ncursesw with c-wrapper
Newsgroups: gmane.lisp.scheme.gauche
Date: 2008-02-24 00:43:19 GMT
Subject: utf-8 strings in ncursesw with c-wrapper
Newsgroups: gmane.lisp.scheme.gauche
Date: 2008-02-24 00:43:19 GMT
Hi. I'm trying to use ncursesw with c-wrapper, with a preamble like:
(use c-wrapper)
(c-load "ncursesw/ncurses.h" :libs "-lncursesw")
And this works:
(initscr)
(mvaddstr 0 0 "Hello, world!")
(refresh)
(endwin)
But this results in mojibake:
(initscr)
(mvaddstr 0 0 "こんにちは、世界!")
(refresh)
(endwin)
The C version works if I call setlocale before starting:
#include <ncursesw/ncurses.h>
#include <locale.h>
int main(void)
{
setlocale(LC_CTYPE, "en_US.UTF-8");
initscr();
mvaddstr(0, 0, "こんにちは世界!");
refresh();
(Continue reading)
RSS Feed