Subject: Codeset support for wscons
To: None <tech-kern@netbsd.org>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: tech-kern
Date: 04/01/2002 13:40:35
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


With Lennart Augustsson addition of cyrillic keysymbols (which is totally
wrong this way) we need a method to pass non-iso8851-1 keystrokes through
wscons.

I propose two ioctl's to get/set a codeset on a screen. The codesets map
keysymbols to 8-bit characters.

Diffs appended. Comments?

-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wscons.diff"

Index: Makefile
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/Makefile,v
retrieving revision 1.4
diff -u -2 -r1.4 Makefile
--- Makefile	2001/04/11 19:07:38	1.4
+++ Makefile	2002/04/01 11:32:48
@@ -4,5 +4,5 @@
 
 # Only install includes which are used by userland
-INCS=	wsconsio.h wsdisplay_usl_io.h wsksymdef.h wsksymdef.h wsksymvar.h
+INCS=	wscodeset.h wsconsio.h wsdisplay_usl_io.h wsksymdef.h wsksymvar.h
 
 .include <bsd.kinc.mk>
Index: files.wscons
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/files.wscons,v
retrieving revision 1.25
diff -u -2 -r1.25 files.wscons
--- files.wscons	2001/11/28 10:21:25	1.25
+++ files.wscons	2002/04/01 11:32:48
@@ -36,4 +36,5 @@
 file	dev/wscons/wsdisplay.c		wsdisplay		needs-flag
 file	dev/wscons/wsdisplay_compat_usl.c wsdisplay & wsdisplay_compat_usl
+file	dev/wscons/wscodeset.c		wsdisplay
 file	dev/wscons/wsemulconf.c		wsdisplay
 file	dev/wscons/wsemul_dumb.c	wsdisplay & !wsemul_no_dumb
Index: wscodeset.c
===================================================================
RCS file: wscodeset.c
diff -N wscodeset.c
--- /dev/null	Mon Apr  1 14:31:55 2002
+++ wscodeset.c	Mon Apr  1 14:32:48 2002
@@ -0,0 +1,249 @@
+/*	$NetBSD: $	*/
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Juergen Hannken-Illjes.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the NetBSD
+ *	Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: $");
+
+#include <sys/param.h>
+#include <sys/cdefs.h>
+#include <sys/errno.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <dev/wscons/wsksymdef.h>
+#include <dev/wscons/wsksymvar.h>
+#include <dev/wscons/wscodeset.h>
+
+struct codeset_s {
+	int codeset;
+	u_int8_t first_char;
+	u_int8_t last_char;
+	keysym_t *ksym_tab;
+};
+
+struct translation_s {
+	keysym_t ksym;
+	u_int8_t value;
+};
+
+struct codeset_tag_s {
+	int codeset;
+	char result[8];
+	int table_size;
+	struct translation_s table[256];
+};
+
+static keysym_t iso8859_1_tab[] = {
+/*a0*/	KS_nobreakspace, KS_exclamdown, KS_cent, KS_sterling,
+/*a4*/	KS_currency, KS_yen, KS_brokenbar, KS_section,
+/*a8*/	KS_diaeresis, KS_copyright, KS_ordfeminine, KS_guillemotleft,
+/*ac*/	KS_notsign, KS_hyphen, KS_registered, KS_macron,
+/*b0*/	KS_degree, KS_plusminus, KS_twosuperior, KS_threesuperior,
+/*b4*/	KS_acute, KS_mu, KS_paragraph, KS_periodcentered,
+/*b8*/	KS_cedilla, KS_onesuperior, KS_masculine, KS_guillemotright,
+/*bc*/	KS_onequarter, KS_onehalf, KS_threequarters, KS_questiondown,
+/*c0*/	KS_Agrave, KS_Aacute, KS_Acircumflex, KS_Atilde,
+/*c4*/	KS_Adiaeresis, KS_Aring, KS_AE, KS_Ccedilla,
+/*c8*/	KS_Egrave, KS_Eacute, KS_Ecircumflex, KS_Ediaeresis,
+/*cc*/	KS_Igrave, KS_Iacute, KS_Icircumflex, KS_Idiaeresis,
+/*d0*/	KS_ETH, KS_Ntilde, KS_Ograve, KS_Oacute,
+/*d4*/	KS_Ocircumflex, KS_Otilde, KS_Odiaeresis, KS_multiply,
+/*d8*/	KS_Ooblique, KS_Ugrave, KS_Uacute, KS_Ucircumflex,
+/*dc*/	KS_Udiaeresis, KS_Yacute, KS_THORN, KS_ssharp,
+/*e0*/	KS_agrave, KS_aacute, KS_acircumflex, KS_atilde,
+/*e4*/	KS_adiaeresis, KS_aring, KS_ae, KS_ccedilla,
+/*e8*/	KS_egrave, KS_eacute, KS_ecircumflex, KS_ediaeresis,
+/*ec*/	KS_igrave, KS_iacute, KS_icircumflex, KS_idiaeresis,
+/*f0*/	KS_eth, KS_ntilde, KS_ograve, KS_oacute,
+/*f4*/	KS_ocircumflex, KS_otilde, KS_odiaeresis, KS_division,
+/*f8*/	KS_oslash, KS_ugrave, KS_uacute, KS_ucircumflex,
+/*fc*/	KS_udiaeresis, KS_yacute, KS_thorn, KS_ydiaeresis
+};
+
+static keysym_t koi8_u_tab[] = {
+/*a0*/	KS_voidSymbol, KS_voidSymbol, KS_voidSymbol, KS_Cyrillic_io,
+/*a4*/	KS_Cyrillic_ieukr, KS_voidSymbol, KS_Cyrillic_iukr, KS_Cyrillic_yi,
+/*a8*/	KS_voidSymbol, KS_voidSymbol, KS_voidSymbol, KS_voidSymbol,
+/*ac*/	KS_voidSymbol, KS_Cyrillic_gheukr, KS_voidSymbol, KS_voidSymbol,
+/*b0*/	KS_voidSymbol, KS_voidSymbol, KS_voidSymbol, KS_Cyrillic_IO,
+/*b4*/	KS_Cyrillic_IEUKR, KS_voidSymbol, KS_Cyrillic_IUKR, KS_Cyrillic_YI,
+/*b8*/	KS_voidSymbol, KS_voidSymbol, KS_voidSymbol, KS_voidSymbol,
+/*bc*/	KS_voidSymbol, KS_Cyrillic_GHEUKR, KS_voidSymbol, KS_voidSymbol,
+/*c0*/	KS_Cyrillic_yu, KS_Cyrillic_a, KS_Cyrillic_be, KS_Cyrillic_tse,
+/*c4*/	KS_Cyrillic_de, KS_Cyrillic_ie, KS_Cyrillic_ef, KS_Cyrillic_ghe,
+/*c8*/	KS_Cyrillic_ha, KS_Cyrillic_i, KS_Cyrillic_shorti, KS_Cyrillic_ka,
+/*cc*/	KS_Cyrillic_el, KS_Cyrillic_em, KS_Cyrillic_en, KS_Cyrillic_o,
+/*d0*/	KS_Cyrillic_pe, KS_Cyrillic_ya, KS_Cyrillic_er, KS_Cyrillic_es,
+/*d4*/	KS_Cyrillic_te, KS_Cyrillic_u, KS_Cyrillic_zhe, KS_Cyrillic_ve,
+/*d8*/	KS_Cyrillic_softsign, KS_Cyrillic_yeru, KS_Cyrillic_ze, KS_Cyrillic_sha,
+/*dc*/	KS_Cyrillic_e, KS_Cyrillic_shcha, KS_Cyrillic_che, KS_Cyrillic_hardsign,
+/*e0*/	KS_Cyrillic_YU, KS_Cyrillic_A, KS_Cyrillic_BE, KS_Cyrillic_TSE,
+/*e4*/	KS_Cyrillic_DE, KS_Cyrillic_IE, KS_Cyrillic_EF, KS_Cyrillic_GHE,
+/*e8*/	KS_Cyrillic_HA, KS_Cyrillic_I, KS_Cyrillic_SHORTI, KS_Cyrillic_KA,
+/*ec*/	KS_Cyrillic_EL, KS_Cyrillic_EM, KS_Cyrillic_EN, KS_Cyrillic_O,
+/*f0*/	KS_Cyrillic_PE, KS_Cyrillic_YA, KS_Cyrillic_ER, KS_Cyrillic_ES,
+/*f4*/	KS_Cyrillic_TE, KS_Cyrillic_U, KS_Cyrillic_ZHE, KS_Cyrillic_VE,
+/*f8*/	KS_Cyrillic_SOFTSIGN, KS_Cyrillic_YERU, KS_Cyrillic_ZE, KS_Cyrillic_SHA,
+/*fc*/	KS_Cyrillic_E, KS_Cyrillic_SHCHA, KS_Cyrillic_CHE, KS_Cyrillic_HARDSIGN
+};
+
+static struct codeset_s codesets[] = {
+	{ CODESET_ISO8859_1,  0xa0, 0xff, iso8859_1_tab },
+	{ CODESET_KOI8_U,     0xa0, 0xff, koi8_u_tab },
+};
+
+/* Default codeset. No malloc because it may be the console. */
+#ifdef WSCODESET_DEFAULT
+static int codeset_default = WSCODESET_DEFAULT;
+#else
+static int codeset_default = CODESET_ISO8859_1;
+#endif
+
+static struct codeset_tag_s codeset_tag_default;
+
+/*
+ * Create a codeset translator. Return a cookie for this translator.
+ */
+void *
+wscodeset_create(int codeset)
+{
+	int i, j;
+	struct codeset_s *cs;
+	struct codeset_tag_s *cs_tag;
+	struct translation_s v;
+
+	/* lookup codeset */
+	if (codeset == 0)
+		codeset = codeset_default;
+
+	cs = NULL;
+
+	for (i = 0; i < sizeof(codesets)/sizeof(codesets[0]); i++)
+		if (codesets[i].codeset == codeset) {
+			cs = codesets + i;
+			break;
+		}
+
+	if (cs == NULL)
+		return(NULL);
+
+	if (codeset == codeset_default)
+		cs_tag = &codeset_tag_default;
+	else
+		cs_tag = malloc(sizeof(*cs_tag), M_DEVBUF, M_WAITOK);
+
+	cs_tag->codeset = cs->codeset;
+	cs_tag->table_size = 0;
+
+	/* Enter 7-bit ascii */
+	for (i = 0; i < 0x80; i++) {
+		cs_tag->table[cs_tag->table_size].ksym = i;
+		cs_tag->table[cs_tag->table_size].value = i;
+		cs_tag->table_size++;
+	}
+
+	/* Enter this codeset */
+	for (i = cs->first_char; i <= cs->last_char; i++)
+		if (cs->ksym_tab[i - cs->first_char] != KS_voidSymbol) {
+			cs_tag->table[cs_tag->table_size].ksym = cs->ksym_tab[i - cs->first_char];
+			cs_tag->table[cs_tag->table_size].value = i;
+			cs_tag->table_size++;
+		}
+
+	/* Insertion sort. */
+	for (i = 1; i < cs_tag->table_size; i++) {
+		v = cs_tag->table[i];
+		/* find correct slot, moving others up */
+		for (j = i; --j >= 0 && v.ksym < cs_tag->table[j].ksym; )
+			cs_tag->table[j + 1] = cs_tag->table[j];
+		cs_tag->table[j + 1] = v;
+	}
+
+	return(cs_tag);
+}
+
+/*
+ * Destroy a codeset translator.
+ */
+void
+wscodeset_destroy(void *cookie)
+{
+	struct codeset_tag_s *cs_tag = cookie;
+
+	if (cs_tag != &codeset_tag_default)
+		free(cs_tag, M_DEVBUF);
+}
+
+/*
+ * Return codeset name from cookie.
+ */
+int
+wscodeset_getname(void *cookie)
+{
+	struct codeset_tag_s *cs_tag = cookie;
+
+	return(cs_tag->codeset);
+}
+
+/*
+ * Translate a keysym. Return the number of characters in result or -1 on error.
+ */
+int
+wscodeset_translate(void *cookie, keysym_t ksym, char **result)
+{
+	int i, j;
+	struct codeset_tag_s *cs_tag = cookie;
+
+	*result = cs_tag->result;
+
+	for (j = 0, i = cs_tag->table_size; i != 0; i /= 2) {
+		if (cs_tag->table[j + i/2].ksym == ksym) {
+			cs_tag->result[0] = cs_tag->table[j + i/2].value;
+			return(1);
+		} else if (cs_tag->table[j + i/2].ksym < ksym) {
+			j += i/2 + 1;
+			i--;
+		}
+	}
+
+#ifdef DEBUG
+	printf("wscodeset_translate: codeset=%d, keysym %04x not found\n",
+	       cs_tag->codeset, ksym);
+#endif
+
+	return(0);
+}
Index: wscodeset.h
===================================================================
RCS file: wscodeset.h
diff -N wscodeset.h
--- /dev/null	Mon Apr  1 14:31:55 2002
+++ wscodeset.h	Mon Apr  1 14:32:48 2002
@@ -0,0 +1,56 @@
+/*	$NetBSD: $	*/
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Juergen Hannken-Illjes.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the NetBSD
+ *	Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _DEV_WSCONS_WSCODESET_H_
+#define _DEV_WSCONS_WSCODESET_H_
+
+#define CODESET_ISO8859_1	  1
+#define CODESET_KOI8_U		100
+
+#define CODESET_TAB \
+	{ CODESET_ISO8859_1,	"iso8859-1" }, \
+	{ CODESET_KOI8_U,	"koi8-u" }, \
+
+#ifdef _KERNEL
+void	*wscodeset_create(int);
+void	wscodeset_destroy(void *);
+int	wscodeset_getname(void *);
+int	wscodeset_translate(void *, keysym_t, char **);
+#endif
+
+#endif /* !_DEV_WSCONS_WSCODESET_H_ */
Index: wsconsio.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/wsconsio.h,v
retrieving revision 1.49
diff -u -2 -r1.49 wsconsio.h
--- wsconsio.h	2002/02/24 02:01:40	1.49
+++ wsconsio.h	2002/04/01 11:32:48
@@ -376,4 +376,7 @@
 #define	WSDISPLAYIO_SETPARAM	_IOWR('W', 83, struct wsdisplay_param)
 
+#define WSDISPLAYIO_GCODESET	_IOR('W', 84, int)
+#define WSDISPLAYIO_SCODESET	_IOW('W', 85, int)
+
 /* XXX NOT YET DEFINED */
 /* Mapping information retrieval. */
Index: wsdisplay.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/wsdisplay.c,v
retrieving revision 1.62
diff -u -2 -r1.62 wsdisplay.c
--- wsdisplay.c	2002/03/17 19:41:05	1.62
+++ wsdisplay.c	2002/04/01 11:32:49
@@ -62,4 +62,5 @@
 #include <dev/wscons/wsksymdef.h>
 #include <dev/wscons/wsemulvar.h>
+#include <dev/wscons/wscodeset.h>
 #include <dev/wscons/wscons_callbacks.h>
 #include <dev/cons.h>
@@ -73,4 +74,5 @@
 	const struct wsemul_ops *wsemul;
 	void	*wsemulcookie;
+	void	*wscodesetcookie;
 };
 
@@ -247,4 +249,5 @@
 		} else
 			dconf->wsemul = NULL;
+		dconf->wscodesetcookie = wscodeset_create(0);
 		dconf->scrdata = type;
 	}
@@ -657,4 +660,6 @@
 								  defattr);
 
+	wsdisplay_console_conf.wscodesetcookie = wscodeset_create(0);
+
 	cn_tab = &wsdisplay_cons;
 	wsdisplay_console_initted = 1;
@@ -916,4 +921,5 @@
 	int error;
 	char namebuf[16];
+	void *cookie;
 	struct wsdisplay_font fd;
 
@@ -985,4 +991,16 @@
 		return (error);
 #undef d
+
+	case WSDISPLAYIO_GCODESET:
+		*(int *)data = wscodeset_getname(scr->scr_dconf->wscodesetcookie);
+		return (0);
+
+	case WSDISPLAYIO_SCODESET:
+		cookie = wscodeset_create(*(int *)data);
+		if (cookie == NULL)
+			return (EINVAL);
+		wscodeset_destroy(scr->scr_dconf->wscodesetcookie);
+		scr->scr_dconf->wscodesetcookie = cookie;
+		return (0);
 	}
 
@@ -1281,7 +1299,9 @@
 	tp = scr->scr_tty;
 
-	if (KS_GROUP(ks) == KS_GROUP_Ascii)
-		(*tp->t_linesw->l_rint)(KS_VALUE(ks), tp);
-	else if (WSSCREEN_HAS_EMULATOR(scr)) {
+	if (KS_GROUP(ks) == KS_GROUP_Ascii) {
+		count = wscodeset_translate(scr->scr_dconf->wscodesetcookie, ks, &dp);
+		while (count-- > 0)
+			(*tp->t_linesw->l_rint)((u_char)*dp++, tp);
+	} else if (WSSCREEN_HAS_EMULATOR(scr)) {
 		count = (*scr->scr_dconf->wsemul->translate)
 		    (scr->scr_dconf->wsemulcookie, ks, &dp);
Index: wsksymdef.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/wsksymdef.h,v
retrieving revision 1.44
diff -u -2 -r1.44 wsksymdef.h
--- wsksymdef.h	2002/03/24 05:43:12	1.44
+++ wsksymdef.h	2002/04/01 11:32:49
@@ -43,5 +43,5 @@
  * Keysymbols encoded as 16-bit Unicode. Special symbols
  * are encoded in the private area (0xe000 - 0xf8ff).
- * Currently only ISO Latin-1 subset is supported.
+ * Currently only a subset of Unicode is supported.
  *
  * This file is parsed from userland. Encode keysyms as:
@@ -259,8 +259,83 @@
 #define	KS_ydiaeresis 		0xff
 
-#define KS_Odoubleacute 	0x150
-#define KS_odoubleacute 	0x151
-#define KS_Udoubleacute 	0x170
-#define KS_udoubleacute 	0x171
+#define KS_Odoubleacute 	0x0150
+#define KS_odoubleacute 	0x0151
+#define KS_Udoubleacute 	0x0170
+#define KS_udoubleacute 	0x0171
+
+#define KS_Cyrillic_IO		0x0401
+#define KS_Cyrillic_IEUKR	0x0404
+#define KS_Cyrillic_IUKR	0x0406
+#define KS_Cyrillic_YI		0x0407
+#define KS_Cyrillic_A		0x0410
+#define KS_Cyrillic_BE		0x0411
+#define KS_Cyrillic_VE		0x0412
+#define KS_Cyrillic_GHE		0x0413
+#define KS_Cyrillic_DE		0x0414
+#define KS_Cyrillic_IE		0x0415
+#define KS_Cyrillic_ZHE		0x0416
+#define KS_Cyrillic_ZE		0x0417
+#define KS_Cyrillic_I		0x0418
+#define KS_Cyrillic_SHORTI	0x0419
+#define KS_Cyrillic_KA		0x041a
+#define KS_Cyrillic_EL		0x041b
+#define KS_Cyrillic_EM		0x041c
+#define KS_Cyrillic_EN		0x041d
+#define KS_Cyrillic_O		0x041e
+#define KS_Cyrillic_PE		0x041f
+#define KS_Cyrillic_ER		0x0420
+#define KS_Cyrillic_ES		0x0421
+#define KS_Cyrillic_TE		0x0422
+#define KS_Cyrillic_U		0x0423
+#define KS_Cyrillic_EF		0x0424
+#define KS_Cyrillic_HA		0x0425
+#define KS_Cyrillic_TSE		0x0426
+#define KS_Cyrillic_CHE		0x0427
+#define KS_Cyrillic_SHA		0x0428
+#define KS_Cyrillic_SHCHA	0x0429
+#define KS_Cyrillic_HARDSIGN	0x042a
+#define KS_Cyrillic_YERU	0x042b
+#define KS_Cyrillic_SOFTSIGN	0x042c
+#define KS_Cyrillic_E		0x042d
+#define KS_Cyrillic_YU		0x042e
+#define KS_Cyrillic_YA		0x042f
+#define KS_Cyrillic_a		0x0430
+#define KS_Cyrillic_be		0x0431
+#define KS_Cyrillic_ve		0x0432
+#define KS_Cyrillic_ghe		0x0433
+#define KS_Cyrillic_de		0x0434
+#define KS_Cyrillic_ie		0x0435
+#define KS_Cyrillic_zhe		0x0436
+#define KS_Cyrillic_ze		0x0437
+#define KS_Cyrillic_i		0x0438
+#define KS_Cyrillic_shorti	0x0439
+#define KS_Cyrillic_ka		0x043a
+#define KS_Cyrillic_el		0x043b
+#define KS_Cyrillic_em		0x043c
+#define KS_Cyrillic_en		0x043d
+#define KS_Cyrillic_o		0x043e
+#define KS_Cyrillic_pe		0x043f
+#define KS_Cyrillic_er		0x0440
+#define KS_Cyrillic_es		0x0441
+#define KS_Cyrillic_te		0x0442
+#define KS_Cyrillic_u		0x0443
+#define KS_Cyrillic_ef		0x0444
+#define KS_Cyrillic_ha		0x0445
+#define KS_Cyrillic_tse		0x0446
+#define KS_Cyrillic_che		0x0447
+#define KS_Cyrillic_sha		0x0448
+#define KS_Cyrillic_shcha	0x0449
+#define KS_Cyrillic_hardsign	0x044a
+#define KS_Cyrillic_yeru	0x044b
+#define KS_Cyrillic_softsign	0x044c
+#define KS_Cyrillic_e		0x044d
+#define KS_Cyrillic_yu		0x044e
+#define KS_Cyrillic_ya		0x044f
+#define KS_Cyrillic_io		0x0451
+#define KS_Cyrillic_ieukr	0x0454
+#define KS_Cyrillic_iukr	0x0456
+#define KS_Cyrillic_yi		0x0457
+#define KS_Cyrillic_GHEUKR	0x0490
+#define KS_Cyrillic_gheukr	0x0491
 
 /*
@@ -275,85 +350,4 @@
 #define	KS_dead_abovering 	0x030a
 #define	KS_dead_cedilla 	0x0327
-
-/*
- * Group Cyrillic (koi8-r)
- */
-
-#define KS_Cyrillic_A		0xe1
-#define KS_Cyrillic_BE		0xe2
-#define KS_Cyrillic_VE		0xf7
-#define KS_Cyrillic_GHE		0xe7
-#define KS_Cyrillic_DE		0xe4
-#define KS_Cyrillic_IE		0xe5
-#define KS_Cyrillic_IO		0xb3
-#define KS_Cyrillic_ZHE		0xf6
-#define KS_Cyrillic_ZE		0xfa
-#define KS_Cyrillic_I		0xe9
-#define KS_Cyrillic_SHORTI	0xea
-#define KS_Cyrillic_IUKR	0xb6
-#define KS_Cyrillic_YI		0xb7
-#define KS_Cyrillic_KA		0xeb
-#define KS_Cyrillic_EL		0xec
-#define KS_Cyrillic_EM		0xed
-#define KS_Cyrillic_EN		0xee
-#define KS_Cyrillic_O		0xef
-#define KS_Cyrillic_PE		0xf0
-#define KS_Cyrillic_ER		0xf2
-#define KS_Cyrillic_ES		0xf3
-#define KS_Cyrillic_TE		0xf4
-#define KS_Cyrillic_U		0xf5
-#define KS_Cyrillic_EF		0xe6
-#define KS_Cyrillic_HA		0xe8
-#define KS_Cyrillic_TSE		0xe3
-#define KS_Cyrillic_CHE		0xfe
-#define KS_Cyrillic_SHA		0xfb
-#define KS_Cyrillic_SHCHA	0xfd
-#define KS_Cyrillic_HARDSIGN	0xff
-#define KS_Cyrillic_YERU	0xf9
-#define KS_Cyrillic_SOFTSIGN	0xf8
-#define KS_Cyrillic_E		0xfc
-#define KS_Cyrillic_YU		0xe0
-#define KS_Cyrillic_YA		0xf1
-
-#define KS_Cyrillic_a		0xc1
-#define KS_Cyrillic_be		0xc2
-#define KS_Cyrillic_ve		0xd7
-#define KS_Cyrillic_ghe		0xc7
-#define KS_Cyrillic_de		0xc4
-#define KS_Cyrillic_ie		0xc5
-#define KS_Cyrillic_io		0xa3
-#define KS_Cyrillic_zhe		0xd6
-#define KS_Cyrillic_ze		0xda
-#define KS_Cyrillic_i		0xc9
-#define KS_Cyrillic_shorti	0xca
-#define KS_Cyrillic_iukr	0xa6
-#define KS_Cyrillic_yi		0xa7
-#define KS_Cyrillic_ka		0xcb
-#define KS_Cyrillic_el		0xcc
-#define KS_Cyrillic_em		0xcd
-#define KS_Cyrillic_en		0xce
-#define KS_Cyrillic_o		0xcf
-#define KS_Cyrillic_pe		0xd0
-#define KS_Cyrillic_er		0xd2
-#define KS_Cyrillic_es		0xd3
-#define KS_Cyrillic_te		0xd4
-#define KS_Cyrillic_u		0xd5
-#define KS_Cyrillic_ef		0xc6
-#define KS_Cyrillic_ha		0xc8
-#define KS_Cyrillic_tse		0xc3
-#define KS_Cyrillic_che		0xde
-#define KS_Cyrillic_sha		0xdb
-#define KS_Cyrillic_shcha	0xdd
-#define KS_Cyrillic_hardsign	0xdf
-#define KS_Cyrillic_yeru	0xd9
-#define KS_Cyrillic_softsign	0xd8
-#define KS_Cyrillic_e		0xdc
-#define KS_Cyrillic_yu		0xc0
-#define KS_Cyrillic_ya		0xd1
-
-#define KS_Cyrillic_gheukr	0xad
-#define KS_Cyrillic_GHEUKR	0xbd
-#define KS_Cyrillic_ieukr	0xa4
-#define KS_Cyrillic_IEUKR	0xb4
 
 /*

--2oS5YaxWCcQjTEyO--