bug-ncurses
[Top][All Lists]
Advanced

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

Re: Problems with get_wch() and wide characters


From: Thomas Dickey
Subject: Re: Problems with get_wch() and wide characters
Date: Wed, 31 Dec 2008 10:22:52 -0500 (EST)

On Sun, 28 Dec 2008, Kim Tore Jensen wrote:

Hello Thomas,

Yes, I tried the setlocale function.

The result was that WACS_* characters stopped working - that is, when
using the line_set functions, they only drew whitespace instead of
borders.

If the terminal isn't setup for UTF-8, it can do that (but I'd expect
the other non-ASCII characters to stop working as well).  Do you have
a simple test-case that you can demonstrate it with?  The test programs
in ncurses appear to work properly - tested with uxterm for instance.


Regarding your second email, system locales are set to:

$ export|egrep "(LOCALE|LANG|LC_ALL)"
declare -x LANG="en_US.utf8"
declare -x XTERM_LOCALE="en_US.utf8"

However, I tried changing these and setting it with
        setlocale(LC_ALL, "nb_NO.utf8");
        setlocale(LC_ALL, "en_US.utf8");
        setlocale(LC_ALL, "");

Ncurses seems to be an Arch build of 5.7:

$ ncursesw5-config --version
5.7.20081102


Best regards,
Kim Tore Jensen


On Thu, Dec 25, 2008 at 07:01:10AM -0500, Thomas Dickey wrote:
On Wed, 24 Dec 2008, Kim Tore Jensen wrote:

Hello,

I am attempting to get a wide character using the get_wch function:

{
        int chartype;
        wint_t ch;
        chartype = get_wch(&ch);
}

When typing ASCII characters as 'a', 'b', 'c' etc., they are returned
with chartype = 0 and ch = 'a', 'b', 'c' etc.

However, when typing non-ASCII characters as the Norwegian letters
'?', '?', '?', they are not recognized. get_wch() returns only ERR and
sets ch to 0.

I use raw() and keypad(), and my LANG is exported to "nb_NO.utf8".
System locales in general work well and my shell interprets these
characters OK.

did your program do
        setlocale(LC_ALL, "");

?

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



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

reply via email to

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