[Top][All Lists]

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

Re: ncursesw + non-utf8 locales

From: Thomas Dickey
Subject: Re: ncursesw + non-utf8 locales
Date: Mon, 17 Oct 2011 16:48:49 -0400 (EDT)

On Mon, 17 Oct 2011, Felix Natter wrote:


Sorry for not trying to post to address@hidden, but there's no
chance of getting an answer there :-(

yes (the alias was never used).

I am co-developer of the typing tutor gtypist, which saves its
lesson files in UTF-8, uses mbstowcs() to convert them to wchar_t*
and outputs each character with ncurses' add_wch().

This works fine with all utf-8 locales, but not with ISO-8859-1
locales (LC_ALL=de_DE for me, because this is a ISO-8859-1 locale).

I have attached a minimal example that includes the wideaddch() and
widen() helper functions I wrote. If you choose a ISO-8859-1 locale for
setlocale(), and switch gnome-terminal to Western (ISO-8859-15, which
should be compatible), then you see only garbage on the screen.
I guess this is to be expected when you try to output wchar_t (UTF-32?)
to a 8bit console.

I'll look over your test program and see what can be done.

Thomas E. Dickey

reply via email to

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