[Top][All Lists]

[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: Sat, 27 Dec 2008 17:02:38 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Dec 24, 2008 at 02:45:53PM +0100, 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.

2nd reply - I noticed that in this email, the non-ASCII characters
you're using are not UTF-8, but are one of the ISO-8859-x flavors.
That is, 

        'æ' is 0xE6
        'ø' is 0xF8
        'å' is 0xE5

get_wch() in a UTF-8 encoding such as "nb_NO.utf8" will be looking
for UTF-8, which happens to use the same range of codes, but organized
as multiple bytes.  The UTF-8 encoding for the same characters would
look like (in this ISO-8859-1 email...):

> 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.
> Any suggestions on how to make ncurses recognize these characters?
> Best regards,
> Kim Tore Jensen

> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-ncurses

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: Digital signature

reply via email to

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