bug-ncurses
[Top][All Lists]
Advanced

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

Re: extended ASCII characters do not show up


From: Thomas Dickey
Subject: Re: extended ASCII characters do not show up
Date: Sat, 1 Oct 2005 12:34:19 -0400 (EDT)

On Sat, 1 Oct 2005, amores perros wrote:




From: Thomas Dickey Subject: Re: extended ASCII characters do not show up
Date: Sat, 1 Oct 2005 11:33:16 -0400 (EDT)
That sounds as if you're running a program in the Linux console.
When it's set to UTF-8 mode, it ignores the vt100-style line-drawing,
and gives the same effect.  In that combination, the only way to get
line-drawing is to use libncursesw (which can write UTF-8) rather than
libncurses (which cannot).

--


#1)
I posted earlier about my struggle to get ncurses working with UTF-8
under linux, and I got it working by including and linking to ncursesw -- but
its working -- AFAICT -- without me adding the XOPEN define you
had mentioned. Do I need that XOPEN define?

You only need the _XOPEN_SOURCE_EXTENDED definition to use the features of
libncursesw which are not in libncurses, e.g., get_wch().


#2)
I don't understand how line drawing characters (such as AC_VLINE, I
think) work with UTF-8? That is, I don't know what they could
expand to that would work, unless they (macros I assume) expand
to characters between 0 and 0x20 which are not otherwise used.
I've looked in the ncurses faq for UTF-8, but if the answer is there
I overlooked it :(

yes (it did occur to me that I should add this to my faq - on my to-do list).

The ACS_xxx symbols are a character (which corresponds to the vt100 line-drawing), with A_ALTCHARSET added. ncurses keeps track of the A_ALTCHARSET, and when it is time to write the data to the screen, checks to see if the encoding is UTF-8. If so, it checks some special cases (such as Linux console) to see if it should not try to use the terminfo string to transform its internal character to the terminal's equivalent.

For Linux console in UTF-8 mode, the line-drawing characters are all represented as 3 bytes in UTF-8 encoding. That isn't compatible with the terminfo acsc string (which always does 1 byte mapped to another 1 byte).

The table that ncurses uses for the UTF-8 line-drawing is in
        ncurses/widechar/lib_wacs.c
That lists the Unicode values such as
        { 'q',  { '-',  0x2500 }},      /* horizontal line */

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




reply via email to

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