diff -Nru old/include/hash.h ssl/include/hash.h
--- old/include/hash.h	2003-10-03 22:39:25.000000000 +0400
+++ ssl/include/hash.h	2003-12-06 02:33:33.328125000 +0300
@@ -57,4 +57,6 @@
 /* XXX ZZZ */
 extern void free_list_task(struct ListTask *, struct Client *);
 extern void safe_list_channels(struct Client *source_p, struct ListTask *, int, int);
+
+extern unsigned char csim(unsigned char c);
 #endif  /* INCLUDED_hash_h */
diff -Nru old/src/hash.c ssl/src/hash.c
--- old/src/hash.c	2003-10-24 15:38:44.000000000 +0400
+++ ssl/src/hash.c	2003-12-06 02:04:56.171875000 +0300
@@ -141,7 +141,7 @@
 
   /* Here is to what we "map" a char before working on it */
   for (i = CHAR_MIN; i <= CHAR_MAX; i++)
-    hash_weight(i) = ((unsigned int) ToLower(i)) ^ weight_key;
+    hash_weight(i) = csim(((unsigned int) ToLower(i))) ^ weight_key;
 
   /* Clear the hash tables first */
   for (l = 0; l < HASHSIZE; l++)
diff -Nru old/src/match.c ssl/src/match.c
--- old/src/match.c	2003-08-03 18:22:23.000000000 +0400
+++ ssl/src/match.c	2003-12-06 02:52:51.984375000 +0300
@@ -24,6 +24,7 @@
 #include "irc_getaddrinfo.h"
 #include "client.h"
 #include "ircd.h"
+#include "hash.h"
 
 /* match()
  * 
@@ -38,6 +39,7 @@
  */
 #define MATCH_MAX_CALLS 512  /* ACK! This dies when it's less that this
                                 and we have long lines to parse */
+
 int
 match(const char *mask, const char *name)
 {
@@ -92,7 +94,7 @@
         m++;
       return (*m == 0);
     }
-    if (ToLower(*m) != ToLower(*n) && *m != '?')
+    if (csim(ToLower(*m)) != csim(ToLower(*n)) && *m != '?')
     {
       if (!wild)
         return(0);
@@ -193,8 +195,7 @@
         m++;
       return (*m == 0);
     }
-    if (ToLower(*m) != ToLower(*n) && !(!quote && *m == '?'))
-    {
+    if (csim(ToLower(*m)) != csim(ToLower(*n)) && !(!quote && *m == '?')) {
       if (!wild)
         return(0);
       m = ma;
@@ -387,11 +388,11 @@
 {
   const unsigned char *str1 = (const unsigned char *)s1;
   const unsigned char *str2 = (const unsigned char *)s2;
-
+  int res;
   assert(s1 != NULL);
   assert(s2 != NULL);
   
-  while (ToUpper(*str1) == ToUpper(*str2))
+  while ((res = csim(ToUpper(*str1)) - csim(ToUpper(*str2))) == 0)
   {
     if (*str1 == '\0')
       return(0);
@@ -410,7 +411,7 @@
   assert(s1 != NULL);
   assert(s2 != NULL);
 
-  while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
+  while ((res = csim(ToUpper(*str1)) - csim(ToUpper(*str2))) == 0)
   {
     str1++; str2++; n--;
     if (n == 0 || (*str1 == '\0' && *str2 == '\0'))
@@ -419,7 +420,8 @@
   return(res);
 }
 
-const unsigned char ToLowerTab[] = { 
+/* cp1251 tolower table -KZer-Za */
+const unsigned char ToLowerTab[] = {
   0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
   0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
   0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
@@ -440,21 +442,22 @@
   0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
   0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
   0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-  0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
+  0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xb8, 0xa9,
   0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
   0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
   0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-  0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
-  0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-  0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
-  0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+  0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
+  0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
+  0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
   0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
   0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
   0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
   0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
 };
 
-const unsigned char ToUpperTab[] = { 
+/* cp1251 tolower table -KZer-Za */
+const unsigned char ToUpperTab[] = {
   0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
   0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
   0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
@@ -477,16 +480,16 @@
   0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
   0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
   0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-  0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+  0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xa8, 0xb9,
   0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
   0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
   0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
   0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
   0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-  0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
-  0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
-  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
-  0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff 
+  0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
+  0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+  0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
+  0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf
 };
 
 /*
@@ -538,7 +541,7 @@
 /* ' */      PRINT_C|CHAN_C|NONEOS_C,
 /* ( */      PRINT_C|CHAN_C|NONEOS_C,
 /* ) */      PRINT_C|CHAN_C|NONEOS_C,
-/* * */      PRINT_C|KWILD_C|MWILD_C|CHAN_C|NONEOS_C|SERV_C,
+/* * */      PRINT_C|KWILD_C|CHAN_C|NONEOS_C|SERV_C,
 /* + */      PRINT_C|CHAN_C|NONEOS_C,
 /* , */      PRINT_C|NONEOS_C,
 /* - */      PRINT_C|NICK_C|CHAN_C|NONEOS_C|USER_C|HOST_C,
@@ -559,7 +562,7 @@
 /* < */      PRINT_C|CHAN_C|NONEOS_C,
 /* = */      PRINT_C|CHAN_C|NONEOS_C,
 /* > */      PRINT_C|CHAN_C|NONEOS_C,
-/* ? */      PRINT_C|KWILD_C|MWILD_C|CHAN_C|NONEOS_C,
+/* ? */      PRINT_C|KWILD_C|CHAN_C|NONEOS_C,
 /* @ */      PRINT_C|KWILD_C|CHAN_C|NONEOS_C,
 /* A */      PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C|HOST_C,
 /* B */      PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C|HOST_C,
@@ -664,7 +667,7 @@
 /* 0xA5 */   CHAN_C|NONEOS_C,
 /* 0xA6 */   CHAN_C|NONEOS_C,
 /* 0xA7 */   CHAN_C|NONEOS_C,
-/* 0xA8 */   CHAN_C|NONEOS_C,
+/* 0xA8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
 /* 0xA9 */   CHAN_C|NONEOS_C,
 /* 0xAA */   CHAN_C|NONEOS_C,
 /* 0xAB */   CHAN_C|NONEOS_C,
@@ -680,7 +683,7 @@
 /* 0xB5 */   CHAN_C|NONEOS_C,
 /* 0xB6 */   CHAN_C|NONEOS_C,
 /* 0xB7 */   CHAN_C|NONEOS_C,
-/* 0xB8 */   CHAN_C|NONEOS_C,
+/* 0xB8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
 /* 0xB9 */   CHAN_C|NONEOS_C,
 /* 0xBA */   CHAN_C|NONEOS_C,
 /* 0xBB */   CHAN_C|NONEOS_C,
@@ -688,68 +691,349 @@
 /* 0xBD */   CHAN_C|NONEOS_C,
 /* 0xBE */   CHAN_C|NONEOS_C,
 /* 0xBF */   CHAN_C|NONEOS_C,
-/* 0xC0 */   CHAN_C|NONEOS_C,
-/* 0xC1 */   CHAN_C|NONEOS_C,
-/* 0xC2 */   CHAN_C|NONEOS_C,
-/* 0xC3 */   CHAN_C|NONEOS_C,
-/* 0xC4 */   CHAN_C|NONEOS_C,
-/* 0xC5 */   CHAN_C|NONEOS_C,
-/* 0xC6 */   CHAN_C|NONEOS_C,
-/* 0xC7 */   CHAN_C|NONEOS_C,
-/* 0xC8 */   CHAN_C|NONEOS_C,
-/* 0xC9 */   CHAN_C|NONEOS_C,
-/* 0xCA */   CHAN_C|NONEOS_C,
-/* 0xCB */   CHAN_C|NONEOS_C,
-/* 0xCC */   CHAN_C|NONEOS_C,
-/* 0xCD */   CHAN_C|NONEOS_C,
-/* 0xCE */   CHAN_C|NONEOS_C,
-/* 0xCF */   CHAN_C|NONEOS_C,
-/* 0xD0 */   CHAN_C|NONEOS_C,
-/* 0xD1 */   CHAN_C|NONEOS_C,
-/* 0xD2 */   CHAN_C|NONEOS_C,
-/* 0xD3 */   CHAN_C|NONEOS_C,
-/* 0xD4 */   CHAN_C|NONEOS_C,
-/* 0xD5 */   CHAN_C|NONEOS_C,
-/* 0xD6 */   CHAN_C|NONEOS_C,
-/* 0xD7 */   CHAN_C|NONEOS_C,
-/* 0xD8 */   CHAN_C|NONEOS_C,
-/* 0xD9 */   CHAN_C|NONEOS_C,
-/* 0xDA */   CHAN_C|NONEOS_C,
-/* 0xDB */   CHAN_C|NONEOS_C,
-/* 0xDC */   CHAN_C|NONEOS_C,
-/* 0xDD */   CHAN_C|NONEOS_C,
-/* 0xDE */   CHAN_C|NONEOS_C,
-/* 0xDF */   CHAN_C|NONEOS_C,
-/* 0xE0 */   CHAN_C|NONEOS_C,
-/* 0xE1 */   CHAN_C|NONEOS_C,
-/* 0xE2 */   CHAN_C|NONEOS_C,
-/* 0xE3 */   CHAN_C|NONEOS_C,
-/* 0xE4 */   CHAN_C|NONEOS_C,
-/* 0xE5 */   CHAN_C|NONEOS_C,
-/* 0xE6 */   CHAN_C|NONEOS_C,
-/* 0xE7 */   CHAN_C|NONEOS_C,
-/* 0xE8 */   CHAN_C|NONEOS_C,
-/* 0xE9 */   CHAN_C|NONEOS_C,
-/* 0xEA */   CHAN_C|NONEOS_C,
-/* 0xEB */   CHAN_C|NONEOS_C,
-/* 0xEC */   CHAN_C|NONEOS_C,
-/* 0xED */   CHAN_C|NONEOS_C,
-/* 0xEE */   CHAN_C|NONEOS_C,
-/* 0xEF */   CHAN_C|NONEOS_C,
-/* 0xF0 */   CHAN_C|NONEOS_C,
-/* 0xF1 */   CHAN_C|NONEOS_C,
-/* 0xF2 */   CHAN_C|NONEOS_C,
-/* 0xF3 */   CHAN_C|NONEOS_C,
-/* 0xF4 */   CHAN_C|NONEOS_C,
-/* 0xF5 */   CHAN_C|NONEOS_C,
-/* 0xF6 */   CHAN_C|NONEOS_C,
-/* 0xF7 */   CHAN_C|NONEOS_C,
-/* 0xF8 */   CHAN_C|NONEOS_C,
-/* 0xF9 */   CHAN_C|NONEOS_C,
-/* 0xFA */   CHAN_C|NONEOS_C,
-/* 0xFB */   CHAN_C|NONEOS_C,
-/* 0xFC */   CHAN_C|NONEOS_C,
-/* 0xFD */   CHAN_C|NONEOS_C,
-/* 0xFE */   CHAN_C|NONEOS_C,
-/* 0xFF */   CHAN_C|NONEOS_C
+
+/*********************************************************************/
+/* cyrillization for cp1251 by KZer-Za only cp1251 is supported now. */
+/*********************************************************************/
+
+/* 0xC0 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC1 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC2 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC3 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC4 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC5 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC6 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC7 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xC9 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCA */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCB */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCC */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCD */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCE */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xCF */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD0 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD1 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD2 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD3 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD4 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD5 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD6 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD7 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xD9 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDA */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDB */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDC */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDD */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDE */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xDF */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE0 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE1 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE2 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE3 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE4 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE5 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE6 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE7 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xE9 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xEA */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xEB */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xEC */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xED */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xEE */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xEF */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF0 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF1 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF2 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF3 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF4 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF5 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF6 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF7 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF8 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xF9 */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFA */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFB */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFC */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFD */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFE */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C,
+/* 0xFF */   PRINT_C|ALPHA_C|NICK_C|CHAN_C|NONEOS_C|USER_C
+};
+
+/*
+        this table prevents similair nick usage
+        checking BOBA against ÷ï÷á gives a match and possible
+        message from server what this nick is already used
+        but the users still free to use any liters in their
+        nicks or channel names
+
+        - KZer-Za
+        - this tiny patch also remove AWFUL problem of
+           nick stealing or shadowing
+
+	 - copyrights ne stiraem kak nekotorie. ggg -sheyh
+*/
+
+static unsigned char csim_table[] = {
+/* 0x0 , 0 */                        0x0,                /*   0   */
+/* 0x1 , 1 */                        0x1,                /*   0   */
+/* 0x2 , 2 */                        0x2,                /*   0   */
+/* 0x3 , 3 */                        0x3,                /*   0   */
+/* 0x4 , 4 */                        0x4,                /*   0   */
+/* 0x5 , 5 */                        0x5,                /*   0   */
+/* 0x6 , 6 */                        0x6,                /*   0   */
+/* 0x7 , 7 */                        0x7,                /*   0   */
+/* 0x8 , 8 */                        0x8,                /*   0   */
+/* 0x9 , 9 */                        0x9,                /*   0   */
+/* 0xa , 10 */                        0xa,                /*   0   */
+/* 0xb , 11 */                        0xb,                /*   0   */
+/* 0xc , 12 */                        0xc,                /*   0   */
+/* 0xd , 13 */                        0xd,                /*   0   */
+/* 0xe , 14 */                        0xe,                /*   0   */
+/* 0xf , 15 */                        0xf,                /*   0   */
+/* 0x10 , 16 */                        0x10,                /*   0   */
+/* 0x11 , 17 */                        0x11,                /*   0   */
+/* 0x12 , 18 */                        0x12,                /*   0   */
+/* 0x13 , 19 */                        0x13,                /*   0   */
+/* 0x14 , 20 */                        0x14,                /*   0   */
+/* 0x15 , 21 */                        0x15,                /*   0   */
+/* 0x16 , 22 */                        0x16,                /*   0   */
+/* 0x17 , 23 */                        0x17,                /*   0   */
+/* 0x18 , 24 */                        0x18,                /*   0   */
+/* 0x19 , 25 */                        0x19,                /*   0   */
+/* 0x1a , 26 */                        0x1a,                /*   0   */
+/* 0x1b , 27 */                        0x1b,                /*   0   */
+/* 0x1c , 28 */                        0x1c,                /*   0   */
+/* 0x1d , 29 */                        0x1d,                /*   0   */
+/* 0x1e , 30 */                        0x1e,                /*   0   */
+/* 0x1f , 31 */                        0x1f,                /*   0   */
+/* 0x20 , 32 */                        0x20,                /*       */
+/* 0x21 , 33 */                        0x21,                /*   !   */
+/* 0x22 , 34 */                        0x22,                /*   "   */
+/* 0x23 , 35 */                        0x23,                /*   #   */
+/* 0x24 , 36 */                        0x24,                /*   $   */
+/* 0x25 , 37 */                        0x25,                /*   %   */
+/* 0x26 , 38 */                        0x26,                /*   &   */
+/* 0x27 , 39 */                        0x27,                /*   '   */
+/* 0x28 , 40 */                        0x28,                /*   (   */
+/* 0x29 , 41 */                        0x29,                /*   )   */
+/* 0x2a , 42 */                        0x2a,                /*   *   */
+/* 0x2b , 43 */                        0x2b,                /*   +   */
+/* 0x2c , 44 */                        0x2c,                /*   ,   */
+/* 0x2d , 45 */                        0x2d,                /*   -   */
+/* 0x2e , 46 */                        0x2e,                /*   .   */
+/* 0x2f , 47 */                        0x2f,                /*   /   */
+/* 0x30 , 48 */                        0x30,                /*   0   */
+/* 0x31 , 49 */                        0x31,                /*   1   */
+/* 0x32 , 50 */                        0x32,                /*   2   */
+/* 0x33 , 51 */                        0x33,                /*   3   */
+/* 0x34 , 52 */                        0x34,                /*   4   */
+/* 0x35 , 53 */                        0x35,                /*   5   */
+/* 0x36 , 54 */                        0x36,                /*   6   */
+/* 0x37 , 55 */                        0x37,                /*   7   */
+/* 0x38 , 56 */                        0x38,                /*   8   */
+/* 0x39 , 57 */                        0x39,                /*   9   */
+/* 0x3a , 58 */                        0x3a,                /*   :   */
+/* 0x3b , 59 */                        0x3b,                /*   ;   */
+/* 0x3c , 60 */                        0x3c,                /*   <   */
+/* 0x3d , 61 */                        0x3d,                /*   =   */
+/* 0x3e , 62 */                        0x3e,                /*   >   */
+/* 0x3f , 63 */                        0x3f,                /*   ?   */
+/* 0x40 , 64 */                        0x40,                /*   @   */
+/* 0x41 , 65 */                        0x41,                /*   A   */
+/* 0x42 , 66 */                        0x42,                /*   B   */
+/* 0x43 , 67 */                        0x43,                /*   C   */
+/* 0x44 , 68 */                        0x44,                /*   D   */
+/* 0x45 , 69 */                        0x45,                /*   E   */
+/* 0x46 , 70 */                        0x46,                /*   F   */
+/* 0x47 , 71 */                        0x47,                /*   G   */
+/* 0x48 , 72 */                        0x48,                /*   H   */
+/* 0x49 , 73 */                        0x49,                /*   I   */
+/* 0x4a , 74 */                        0x4a,                /*   J   */
+/* 0x4b , 75 */                        0x4b,                /*   K   */
+/* 0x4c , 76 */                        0x4c,                /*   L   */
+/* 0x4d , 77 */                        0x4d,                /*   M   */
+/* 0x4e , 78 */                        0x4e,                /*   N   */
+/* 0x4f , 79 */                        0x4f,                /*   O   */
+/* 0x50 , 80 */                        0x50,                /*   P   */
+/* 0x51 , 81 */                        0x51,                /*   Q   */
+/* 0x52 , 82 */                        0x52,                /*   R   */
+/* 0x53 , 83 */                        0x53,                /*   S   */
+/* 0x54 , 84 */                        0x54,                /*   T   */
+/* 0x55 , 85 */                        0x55,                /*   U   */
+/* 0x56 , 86 */                        0x56,                /*   V   */
+/* 0x57 , 87 */                        0x57,                /*   W   */
+/* 0x58 , 88 */                        0x58,                /*   X   */
+/* 0x59 , 89 */                        0x59,                /*   Y   */
+/* 0x5a , 90 */                        0x5a,                /*   Z   */
+/* 0x5b , 91 */                        0x5b,                /*   [   */
+/* 0x5c , 92 */                        0x5c,                /*   \   */
+/* 0x5d , 93 */                        0x5d,                /*   ]   */
+/* 0x5e , 94 */                        0x5e,                /*   ^   */
+/* 0x5f , 95 */                        0x5f,                /*   _   */
+/* 0x60 , 96 */                        0x60,                /*   `   */
+/* 0x61 , 97 */                        0x61,                /*   a   */
+/* 0x62 , 98 */                        0x62,                /*   b   */
+/* 0x63 , 99 */                        0x63,                /*   c   */
+/* 0x64 , 100 */                        0x64,                /*   d   */
+/* 0x65 , 101 */                        0x65,                /*   e   */
+/* 0x66 , 102 */                        0x66,                /*   f   */
+/* 0x67 , 103 */                        0x67,                /*   g   */
+/* 0x68 , 104 */                        0x68,                /*   h   */
+/* 0x69 , 105 */                        0x69,                /*   i   */
+/* 0x6a , 106 */                        0x6a,                /*   j   */
+/* 0x6b , 107 */                        0x6b,                /*   k   */
+/* 0x6c , 108 */                        0x6c,                /*   l   */
+/* 0x6d , 109 */                        0x6d,                /*   m   */
+/* 0x6e , 110 */                        0x6e,                /*   n   */
+/* 0x6f , 111 */                        0x6f,                /*   o   */
+/* 0x70 , 112 */                        0x70,                /*   p   */
+/* 0x71 , 113 */                        0x71,                /*   q   */
+/* 0x72 , 114 */                        0x72,                /*   r   */
+/* 0x73 , 115 */                        0x73,                /*   s   */
+/* 0x74 , 116 */                        0x74,                /*   t   */
+/* 0x75 , 117 */                        0x75,                /*   u   */
+/* 0x76 , 118 */                        0x76,                /*   v   */
+/* 0x77 , 119 */                        0x77,                /*   w   */
+/* 0x78 , 120 */                        0x78,                /*   x   */
+/* 0x79 , 121 */                        0x79,                /*   y   */
+/* 0x7a , 122 */                        0x7a,                /*   z   */
+/* 0x7b , 123 */                        0x7b,                /*   {   */
+/* 0x7c , 124 */                        0x7c,                /*   |   */
+/* 0x7d , 125 */                        0x7d,                /*   }   */
+/* 0x7e , 126 */                        0x7e,                /*   ~   */
+/* 0x7f , 127 */                        0x7f,                /*     */
+/* 0x80 , 128 */                        0x80,                /*   €   */
+/* 0x81 , 129 */                        0x81,                /*   �   */
+/* 0x82 , 130 */                        0x82,                /*   ‚   */
+/* 0x83 , 131 */                        0x83,                /*   ƒ   */
+/* 0x84 , 132 */                        0x84,                /*   „   */
+/* 0x85 , 133 */                        0x85,                /*   …   */
+/* 0x86 , 134 */                        0x86,                /*   †   */
+/* 0x87 , 135 */                        0x87,                /*   ‡   */
+/* 0x88 , 136 */                        0x88,                /*   ˆ   */
+/* 0x89 , 137 */                        0x89,                /*   ‰   */
+/* 0x8a , 138 */                        0x8a,                /*   Š   */
+/* 0x8b , 139 */                        0x8b,                /*   ‹   */
+/* 0x8c , 140 */                        0x8c,                /*   Œ   */
+/* 0x8d , 141 */                        0x8d,                /*   �   */
+/* 0x8e , 142 */                        0x8e,                /*   Ž   */
+/* 0x8f , 143 */                        0x8f,                /*   �   */
+/* 0x90 , 144 */                        0x90,                /*   �   */
+/* 0x91 , 145 */                        0x91,                /*   ‘   */
+/* 0x92 , 146 */                        0x92,                /*   ’   */
+/* 0x93 , 147 */                        0x93,                /*   “   */
+/* 0x94 , 148 */                        0x94,                /*   ”   */
+/* 0x95 , 149 */                        0x95,                /*   •   */
+/* 0x96 , 150 */                        0x96,                /*   –   */
+/* 0x97 , 151 */                        0x97,                /*   —   */
+/* 0x98 , 152 */                        0x98,                /*   ˜   */
+/* 0x99 , 153 */                        0x99,                /*   ™   */
+/* 0x9a , 154 */                        0x9a,                /*   š   */
+/* 0x9b , 155 */                        0x9b,                /*   ›   */
+/* 0x9c , 156 */                        0x9c,                /*   œ   */
+/* 0x9d , 157 */                        0x9d,                /*   �   */
+/* 0x9e , 158 */                        0x9e,                /*   ž   */
+/* 0x9f , 159 */                        0x9f,                /*   Ÿ   */
+/* 0xa0 , 160 */                        0xa0,                /*       */
+/* 0xa1 , 161 */                        0xa1,                /*   ¡   */
+/* 0xa2 , 162 */                        0xa2,                /*   ¢   */
+/* 0xa3 , 163 */                        0xa3,                /*   £   */
+/* 0xa4 , 164 */                        0xa4,                /*   ¤   */
+/* 0xa5 , 165 */                        0xa5,                /*   ¥   */
+/* 0xa6 , 166 */                        0xa6,                /*   ¦   */
+/* 0xa7 , 167 */                        0xa7,                /*   §   */
+/* 0xa8 , 168 */                        0xa8,                /*   ¨   */
+/* 0xa9 , 169 */                        0xa9,                /*   ©   */
+/* 0xaa , 170 */                        0xaa,                /*   ª   */
+/* 0xab , 171 */                        0xab,                /*   «   */
+/* 0xac , 172 */                        0xac,                /*   ¬   */
+/* 0xad , 173 */                        0xad,                /*   ­   */
+/* 0xae , 174 */                        0xae,                /*   ®   */
+/* 0xaf , 175 */                        0xaf,                /*   ¯   */
+/* 0xb0 , 176 */                        0xb0,                /*   °   */
+/* 0xb1 , 177 */                        0xb1,                /*   ±   */
+/* 0xb2 , 178 */                        0xb2,                /*   ²   */
+/* 0xb3 , 179 */                        0xb3,                /*   ³   */
+/* 0xb4 , 180 */                        0xb4,                /*   ´   */
+/* 0xb5 , 181 */                        0xb5,                /*   µ   */
+/* 0xb6 , 182 */                        0xb6,                /*   ¶   */
+/* 0xb7 , 183 */                        0xb7,                /*   ·   */
+/* 0xb8 , 184 */                        0xb8,                /*   ¸   */
+/* 0xb9 , 185 */                        0xb9,                /*   ¹   */
+/* 0xba , 186 */                        0xba,                /*   º   */
+/* 0xbb , 187 */                        0xbb,                /*   »   */
+/* 0xbc , 188 */                        0xbc,                /*   ¼   */
+/* 0xbd , 189 */                        0xbd,                /*   ½   */
+/* 0xbe , 190 */                        0xbe,                /*   ¾   */
+/* 0xbf , 191 */                        0xbf,                /*   ¿   */
+/* 0xc0 , 192 */                        'A',                /*   À   */
+/* 0xc1 , 193 */                        0xc1,                /*   Á   */
+/* 0xc2 , 194 */                        'B',                /*   Â   */
+/* 0xc3 , 195 */                        0xc3,                /*   Ã   */
+/* 0xc4 , 196 */                        0xc4,                /*   Ä   */
+/* 0xc5 , 197 */                        'E',                /*   Å   */
+/* 0xc6 , 198 */                        0xc6,                /*   Æ   */
+/* 0xc7 , 199 */                        '3',                /*   Ç   */
+/* 0xc8 , 200 */                        0xc8,                /*   È   */
+/* 0xc9 , 201 */                        0xc9,                /*   É   */
+/* 0xca , 202 */                        'K',                /*   Ê   */
+/* 0xcb , 203 */                        0xcb,                /*   Ë   */
+/* 0xcc , 204 */                        'M',                /*   Ì   */
+/* 0xcd , 205 */                        'H',                /*   Í   */
+/* 0xce , 206 */                        'O',                /*   Î   */
+/* 0xcf , 207 */                        0xcf,                /*   Ï   */
+/* 0xd0 , 208 */                        'P',                /*   Ð   */
+/* 0xd1 , 209 */                        'C',                /*   Ñ   */
+/* 0xd2 , 210 */                        'T',                /*   Ò   */
+/* 0xd3 , 211 */                        'Y',                /*   Ó   */
+/* 0xd4 , 212 */                        0xd4,                /*   Ô   */
+/* 0xd5 , 213 */                        'X',                /*   Õ   */
+/* 0xd6 , 214 */                        0xd6,                /*   Ö   */
+/* 0xd7 , 215 */                        0xd7,                /*   ×   */
+/* 0xd8 , 216 */                        0xd8,                /*   Ø   */
+/* 0xd9 , 217 */                        0xd9,                /*   Ù   */
+/* 0xda , 218 */                        'b',                /*   Ú   */
+/* 0xdb , 219 */                        0xdb,                /*   Û   */
+/* 0xdc , 220 */                        'b',                /*   Ü   */
+/* 0xdd , 221 */                        0xdd,                /*   Ý   */
+/* 0xde , 222 */                        0xde,                /*   Þ   */
+/* 0xdf , 223 */                        0xdf,                /*   ß   */
+/* 0xe0 , 224 */                        'a',                /*   à   */
+/* 0xe1 , 225 */                        0xe1,                /*   á   */
+/* 0xe2 , 226 */                        'B',                /*   â   */
+/* 0xe3 , 227 */                        'r',                /*   ã   */
+/* 0xe4 , 228 */                        'g',                /*   ä   */
+/* 0xe5 , 229 */                        'e',                /*   å   */
+/* 0xe6 , 230 */                        0xe6,                /*   æ   */
+/* 0xe7 , 231 */                        '3',                /*   ç   */
+/* 0xe8 , 232 */                        'u',                /*   è   */
+/* 0xe9 , 233 */                        0xe9,                /*   é   */
+/* 0xea , 234 */                        'k',                /*   ê   */
+/* 0xeb , 235 */                        0xeb,                /*   ë   */
+/* 0xec , 236 */                        'm',                /*   ì   */
+/* 0xed , 237 */                        'H',                /*   í   */
+/* 0xee , 238 */                        'o',                /*   î   */
+/* 0xef , 239 */                        'n',                /*   ï   */
+/* 0xf0 , 240 */                        'p',                /*   ð   */
+/* 0xf1 , 241 */                        'c',                /*   ñ   */
+/* 0xf2 , 242 */                        'T',                /*   ò   */
+/* 0xf3 , 243 */                        0xf3,                /*   ó   */
+/* 0xf4 , 244 */                        0xf4,                /*   ô   */
+/* 0xf5 , 245 */                        0xf5,                /*   õ   */
+/* 0xf6 , 246 */                        0xf6,                /*   ö   */
+/* 0xf7 , 247 */                        0xf7,                /*   ÷   */
+/* 0xf8 , 248 */                        0xf8,                /*   ø   */
+/* 0xf9 , 249 */                        0xf9,                /*   ù   */
+/* 0xfa , 250 */                        0xfa,                /*   ú   */
+/* 0xfb , 251 */                        0xfb,                /*   û   */
+/* 0xfc , 252 */                        0xfc,                /*   ü   */
+/* 0xfd , 253 */                        0xfd,                /*   ý   */
+/* 0xfe , 254 */                        0xfe,                /*   þ   */
+/* 0xff , 255 */                        0xff                /*   ÿ   */
 };
+
+unsigned char csim(unsigned char c) {
+        return csim_table[c];
+}
