Re: [PATCH]console:UTF-8 mode compatibility fixes

From: Alexander E. Patrakov
Date: Sat Feb 18 2006 - 23:31:39 EST


Thomas Dickey wrote:

On Sat, 18 Feb 2006, Alexander E. Patrakov wrote:

If ncurses attempt to add some Chinese character to the Linux text
screen, Linux (correctly) prints this replacement character and advances
the cursor by one position. Ncurses think that the cursor has moved two
positions forward. The effect is that when you view the testcase in Lynx
(compiled --with-screen=ncursesw) on Linux console and press PageDown,
the fourth line contains "Thek" instead of "The" in the end.

This disagreement has to be solved somehow.


yes. ncurses has no better information for this than the result from
wcwidth(). Shall we add another kludge to accommodate Linux console?

Maybe yes, since putting wcwidth() into the kernel is a bigger kludge, because linux kernel will never draw CJK, and because after glibc update, kernel and glibc might disagree upon wcwidth of some characters.

So on linux console, ncurses should draw two 0xfffd characters when a character with wcwidth > 1 is requested.

(Are there other terminal emulators with this specific problem?)

Not sure. I will test putty a bit later. Anyway, an environment variable for this kludge may be a good idea.

--
Alexander E. Patrakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/