On Sun, Feb 03, 2002 at 07:34:58PM +0000, Markus Kuhn wrote:
> I believe you are thinking the wrong way here. As soon as you are in
> UTF-8 mode, the only correct way to send block graphics characters to
> the terminal is via the U+25xx UTF-8 sequences, not via terminfo ISO
> 2022 fiddling. Terminfo sequences must *not at all* be used in UTF-8
> locales to draw certain characters.

The way to interface with this doesn't need to change substantially:
make the acsc cap capable of dealing with multibyte encodings.  Then, if
you're in UTF-8, enacs, smacs and rmacs are blank (since there's no state)
and make the acsc mapping map directly to UTF-8 strings.  Exactly how
this string can deal with multibyte characters is an internal terminfo
implementation detail; the end result is that the acsc returned from
terminfo can be interpreted as a multibyte string in the current locale.

Make ncurses deal with this (not difficult) and you get UTF-8 support
without changing the basic terminfo.  (That's important, of course: UTF-8
doesn't need real special casing by things using terminfo, and apps
are more likely to work in older encodings by people who write and test
primarily in UTF-8.)

The only problem with this is how terminfo knows the application wants
or does not want this behavior, since apps using terminfo for purposes
other than actually rendering to the terminal may not want it.

> If wctomb(&seq_hor, 0x2500) > 0, then do not use terminfo to draw this
> graphics character, because you have already the correct sequence to
> draw BOX DRAWINGS LIGHT HORIZONTAL stored in seq_hor.

Then you have to special case these characters further; it'd be nice to
avoid that.

(And, er, don't you mean wctomb(seq_hor, 0x2500)?  seq_hor needs to be a
char[MB_CUR_MAX], not a char.)

Long term, doing this is better than leaving things as they are, of
course; I think the above is better, though.

> Sounds like there are bugs in both ncurses/slang and xterm here at the
> moment that cancel each other out. Both should be fixed as soon as
> possible.

But the terminfo/ncurses/slang problems need to be fixed first; that way
there's no period where line drawing characters simply don't work.

-- 
Glenn Maynard
--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to