Hello!

I use Linux console frequently, usually with KOI8-R charset (USSR cyrillic), 
but I also think that optional UTF-8 support is good :-) 
Since the original RedHat 9 russian keymap is written in KOI8-R (ignoring Unicode),
it still give KOI8-R from keyboard even in UTF-8 mode. It is not right.
But I found that Linux kernel's keymap is 16bit!
It's possible to load Unicode character by "loadkeys" via U+nnnn notation.
I supposed that inconsistence is in non-Unicode-awareness of that .kmap .
Then, I converted all keycodes to Unicode, and this modified keymap gave me UTF-8.
But not only in UTF-8 keyboard mode, in byte mode also :-/
Although my kernel was built with CONFIG_NLS_DEFAULT=koi8-r ,
no attempt to convert cyrillic to KOI8-R was made when I said "unicode_stop". 
Locale where I run "unicode_stop" also was koi8r. 
Evidently, the stupid "unicode_stop" script can't solve this problem
and kernel also failed to give me desired characters' translation.
Probably "loadkeys" made something incorrectly?
Of course, I can generate defkeymap.c with proper Unicode values,
rebuild my kernel and check there, but...
It seems to me that kernel code contains no ability to translate Unicode to 8bit,
so I don't go to waste my time building a new experimental kernel 
due to only change in defkeymap.c :-/

If I'm wrong and such kernel ability exists, my question is:
HOW to use it, how to use 8bit charsets in "kbd_mode -a" (ASCII or XLATE) mode?
Of course, some software may reload keymap as 8bit, 
but IMHO it would be not so good design.


If I'm right and kernel cannot (yet) translate keyboard input to an 8bit charset,
my questions are:

On a *good* Linux (not RedHat 9) should "unicode_stop" change keymap properly?

Is it a good idea to add to drivers/char/keyboard.c 
the Unicode->8bit translation ability?
Kernel always has Unicode->8bit maps for file names' translation,
so this will not increase essentially the kernel complexity.

Is it also a good idea to modify "loadkeys" utility such that
it would convert legacy 8bit keymaps 
(e.g. KOI8-R for Russian or ISO-8859-1 for West Europe)
to kernel Unicode at the load time, according charset specified in .kmap file?
The use of keymaps as 8bit by Unicode-aware kernel seems generally not a good thing.

Console troubles are not only with cyrillic, 
but greek, hebrew, dutch, french keymaps also failed to give Unicode when 
"unicode_start".


-- 
qq~~~~\
/ /\   \
\  /_/ /
 \____/
--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to