diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2007-10-17 10:27:04 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 19:42:52 +0400 |
commit | 04c71976500352d02f60616d2b960267d8c5fe24 (patch) | |
tree | ed0d84a533e26a2c9f18d53413d183252e1d925f /drivers/char/consolemap.c | |
parent | abdbf94d7c6f1fcb2931d5cb7562a6159323b704 (diff) | |
download | linux-04c71976500352d02f60616d2b960267d8c5fe24.tar.xz |
unicode diacritics support
There have been issues with non-latin1 diacritics and unicode.
http://bugzilla.kernel.org/show_bug.cgi?id=7746
Git 759448f459234bfcf34b82471f0dba77a9aca498 `Kernel utf-8 handling'
partly resolved it by adding conversion between diacritics and
unicode. The patch below goes further by just turning diacritics into
unicode, hence providing better future support. The kbd support can be
fetched from
http://bugzilla.kernel.org/attachment.cgi?id=12313
This was tested in all of latin1, latin9, latin2 and unicode with french
and czech dead keys.
Turn the kernel accent_table into unicode, and extend ioctls KDGKBDIACR
and KDSKBDIACR into their equivalents KDGKBDIACRUC and KDSKBDIACR.
New function int conv_uni_to_8bit(u32 uni) for converting unicode into 8bit
_input_. No, we don't want to store the translation, as it is potentially
sparse and large.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Jan Engelhardt <jengelh@gmx.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/consolemap.c')
-rw-r--r-- | drivers/char/consolemap.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index 163f3fce3f84..6b104e45a322 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c @@ -669,19 +669,29 @@ void con_protect_unimap(struct vc_data *vc, int rdonly) p->readonly = rdonly; } +/* + * Always use USER_MAP. These functions are used by the keyboard, + * which shouldn't be affected by G0/G1 switching, etc. + * If the user map still contains default values, i.e. the + * direct-to-font mapping, then assume user is using Latin1. + */ /* may be called during an interrupt */ u32 conv_8bit_to_uni(unsigned char c) { - /* - * Always use USER_MAP. This function is used by the keyboard, - * which shouldn't be affected by G0/G1 switching, etc. - * If the user map still contains default values, i.e. the - * direct-to-font mapping, then assume user is using Latin1. - */ unsigned short uni = translations[USER_MAP][c]; return uni == (0xf000 | c) ? c : uni; } +int conv_uni_to_8bit(u32 uni) +{ + int c; + for (c = 0; c < 0x100; c++) + if (translations[USER_MAP][c] == uni || + (translations[USER_MAP][c] == (c | 0xf000) && uni == c)) + return c; + return -1; +} + int conv_uni_to_pc(struct vc_data *conp, long ucs) { |