OSDN Git Service

Add PuTTY 0.61 to contrib directory.
[ffftp/ffftp.git] / contrib / putty / UNIX / XKEYSYM.C
diff --git a/contrib/putty/UNIX/XKEYSYM.C b/contrib/putty/UNIX/XKEYSYM.C
new file mode 100644 (file)
index 0000000..cdad7de
--- /dev/null
@@ -0,0 +1,1011 @@
+/*\r
+ * xkeysym.c: mapping from X keysyms to Unicode values\r
+ * \r
+ * The basic idea of this is shamelessly cribbed from xterm. The\r
+ * actual character data is generated from Markus Kuhn's proposed\r
+ * redraft of the X11 keysym mapping table, using the following\r
+ * piece of Perl/sh code:\r
+\r
+wget -q -O - http://www.cl.cam.ac.uk/~mgk25/ucs/X11.keysyms | \\r
+perl -ne '/^(\d+)\s+(\d+)\s+[\d\/]+\s+U\+([\dA-Fa-f]+)/ and' \\r
+      -e '  do { $a{$1 * 256+ $2} = hex $3; };' \\r
+      -e 'END { foreach $i (sort {$a <=> $b} keys %a) {' \\r
+      -e '  printf "    {0x%x, 0x%x},\n", $i, $a{$i} } }' \\r
+      -e 'BEGIN { $a{0x13a4} = 0x20ac }'\r
+\r
+ * (The BEGIN clause inserts a mapping for the Euro sign which for\r
+ * some reason isn't in the list but xterm supports. *shrug*.)\r
+ */\r
+\r
+#include "misc.h"\r
+\r
+struct keysym {\r
+    /*\r
+     * Currently nothing in here is above 0xFFFF, so I'll use\r
+     * `unsigned short' to save space.\r
+     */\r
+    unsigned short keysym;\r
+    unsigned short unicode;\r
+};\r
+\r
+static struct keysym keysyms[] = {\r
+    {0x20, 0x20},\r
+    {0x21, 0x21},\r
+    {0x22, 0x22},\r
+    {0x23, 0x23},\r
+    {0x24, 0x24},\r
+    {0x25, 0x25},\r
+    {0x26, 0x26},\r
+    {0x27, 0x27},\r
+    {0x28, 0x28},\r
+    {0x29, 0x29},\r
+    {0x2a, 0x2a},\r
+    {0x2b, 0x2b},\r
+    {0x2c, 0x2c},\r
+    {0x2d, 0x2d},\r
+    {0x2e, 0x2e},\r
+    {0x2f, 0x2f},\r
+    {0x30, 0x30},\r
+    {0x31, 0x31},\r
+    {0x32, 0x32},\r
+    {0x33, 0x33},\r
+    {0x34, 0x34},\r
+    {0x35, 0x35},\r
+    {0x36, 0x36},\r
+    {0x37, 0x37},\r
+    {0x38, 0x38},\r
+    {0x39, 0x39},\r
+    {0x3a, 0x3a},\r
+    {0x3b, 0x3b},\r
+    {0x3c, 0x3c},\r
+    {0x3d, 0x3d},\r
+    {0x3e, 0x3e},\r
+    {0x3f, 0x3f},\r
+    {0x40, 0x40},\r
+    {0x41, 0x41},\r
+    {0x42, 0x42},\r
+    {0x43, 0x43},\r
+    {0x44, 0x44},\r
+    {0x45, 0x45},\r
+    {0x46, 0x46},\r
+    {0x47, 0x47},\r
+    {0x48, 0x48},\r
+    {0x49, 0x49},\r
+    {0x4a, 0x4a},\r
+    {0x4b, 0x4b},\r
+    {0x4c, 0x4c},\r
+    {0x4d, 0x4d},\r
+    {0x4e, 0x4e},\r
+    {0x4f, 0x4f},\r
+    {0x50, 0x50},\r
+    {0x51, 0x51},\r
+    {0x52, 0x52},\r
+    {0x53, 0x53},\r
+    {0x54, 0x54},\r
+    {0x55, 0x55},\r
+    {0x56, 0x56},\r
+    {0x57, 0x57},\r
+    {0x58, 0x58},\r
+    {0x59, 0x59},\r
+    {0x5a, 0x5a},\r
+    {0x5b, 0x5b},\r
+    {0x5c, 0x5c},\r
+    {0x5d, 0x5d},\r
+    {0x5e, 0x5e},\r
+    {0x5f, 0x5f},\r
+    {0x60, 0x60},\r
+    {0x61, 0x61},\r
+    {0x62, 0x62},\r
+    {0x63, 0x63},\r
+    {0x64, 0x64},\r
+    {0x65, 0x65},\r
+    {0x66, 0x66},\r
+    {0x67, 0x67},\r
+    {0x68, 0x68},\r
+    {0x69, 0x69},\r
+    {0x6a, 0x6a},\r
+    {0x6b, 0x6b},\r
+    {0x6c, 0x6c},\r
+    {0x6d, 0x6d},\r
+    {0x6e, 0x6e},\r
+    {0x6f, 0x6f},\r
+    {0x70, 0x70},\r
+    {0x71, 0x71},\r
+    {0x72, 0x72},\r
+    {0x73, 0x73},\r
+    {0x74, 0x74},\r
+    {0x75, 0x75},\r
+    {0x76, 0x76},\r
+    {0x77, 0x77},\r
+    {0x78, 0x78},\r
+    {0x79, 0x79},\r
+    {0x7a, 0x7a},\r
+    {0x7b, 0x7b},\r
+    {0x7c, 0x7c},\r
+    {0x7d, 0x7d},\r
+    {0x7e, 0x7e},\r
+    {0xa0, 0xa0},\r
+    {0xa1, 0xa1},\r
+    {0xa2, 0xa2},\r
+    {0xa3, 0xa3},\r
+    {0xa4, 0xa4},\r
+    {0xa5, 0xa5},\r
+    {0xa6, 0xa6},\r
+    {0xa7, 0xa7},\r
+    {0xa8, 0xa8},\r
+    {0xa9, 0xa9},\r
+    {0xaa, 0xaa},\r
+    {0xab, 0xab},\r
+    {0xac, 0xac},\r
+    {0xad, 0xad},\r
+    {0xae, 0xae},\r
+    {0xaf, 0xaf},\r
+    {0xb0, 0xb0},\r
+    {0xb1, 0xb1},\r
+    {0xb2, 0xb2},\r
+    {0xb3, 0xb3},\r
+    {0xb4, 0xb4},\r
+    {0xb5, 0xb5},\r
+    {0xb6, 0xb6},\r
+    {0xb7, 0xb7},\r
+    {0xb8, 0xb8},\r
+    {0xb9, 0xb9},\r
+    {0xba, 0xba},\r
+    {0xbb, 0xbb},\r
+    {0xbc, 0xbc},\r
+    {0xbd, 0xbd},\r
+    {0xbe, 0xbe},\r
+    {0xbf, 0xbf},\r
+    {0xc0, 0xc0},\r
+    {0xc1, 0xc1},\r
+    {0xc2, 0xc2},\r
+    {0xc3, 0xc3},\r
+    {0xc4, 0xc4},\r
+    {0xc5, 0xc5},\r
+    {0xc6, 0xc6},\r
+    {0xc7, 0xc7},\r
+    {0xc8, 0xc8},\r
+    {0xc9, 0xc9},\r
+    {0xca, 0xca},\r
+    {0xcb, 0xcb},\r
+    {0xcc, 0xcc},\r
+    {0xcd, 0xcd},\r
+    {0xce, 0xce},\r
+    {0xcf, 0xcf},\r
+    {0xd0, 0xd0},\r
+    {0xd1, 0xd1},\r
+    {0xd2, 0xd2},\r
+    {0xd3, 0xd3},\r
+    {0xd4, 0xd4},\r
+    {0xd5, 0xd5},\r
+    {0xd6, 0xd6},\r
+    {0xd7, 0xd7},\r
+    {0xd8, 0xd8},\r
+    {0xd9, 0xd9},\r
+    {0xda, 0xda},\r
+    {0xdb, 0xdb},\r
+    {0xdc, 0xdc},\r
+    {0xdd, 0xdd},\r
+    {0xde, 0xde},\r
+    {0xdf, 0xdf},\r
+    {0xe0, 0xe0},\r
+    {0xe1, 0xe1},\r
+    {0xe2, 0xe2},\r
+    {0xe3, 0xe3},\r
+    {0xe4, 0xe4},\r
+    {0xe5, 0xe5},\r
+    {0xe6, 0xe6},\r
+    {0xe7, 0xe7},\r
+    {0xe8, 0xe8},\r
+    {0xe9, 0xe9},\r
+    {0xea, 0xea},\r
+    {0xeb, 0xeb},\r
+    {0xec, 0xec},\r
+    {0xed, 0xed},\r
+    {0xee, 0xee},\r
+    {0xef, 0xef},\r
+    {0xf0, 0xf0},\r
+    {0xf1, 0xf1},\r
+    {0xf2, 0xf2},\r
+    {0xf3, 0xf3},\r
+    {0xf4, 0xf4},\r
+    {0xf5, 0xf5},\r
+    {0xf6, 0xf6},\r
+    {0xf7, 0xf7},\r
+    {0xf8, 0xf8},\r
+    {0xf9, 0xf9},\r
+    {0xfa, 0xfa},\r
+    {0xfb, 0xfb},\r
+    {0xfc, 0xfc},\r
+    {0xfd, 0xfd},\r
+    {0xfe, 0xfe},\r
+    {0xff, 0xff},\r
+    {0x1a1, 0x104},\r
+    {0x1a2, 0x2d8},\r
+    {0x1a3, 0x141},\r
+    {0x1a5, 0x13d},\r
+    {0x1a6, 0x15a},\r
+    {0x1a9, 0x160},\r
+    {0x1aa, 0x15e},\r
+    {0x1ab, 0x164},\r
+    {0x1ac, 0x179},\r
+    {0x1ae, 0x17d},\r
+    {0x1af, 0x17b},\r
+    {0x1b1, 0x105},\r
+    {0x1b2, 0x2db},\r
+    {0x1b3, 0x142},\r
+    {0x1b5, 0x13e},\r
+    {0x1b6, 0x15b},\r
+    {0x1b7, 0x2c7},\r
+    {0x1b9, 0x161},\r
+    {0x1ba, 0x15f},\r
+    {0x1bb, 0x165},\r
+    {0x1bc, 0x17a},\r
+    {0x1bd, 0x2dd},\r
+    {0x1be, 0x17e},\r
+    {0x1bf, 0x17c},\r
+    {0x1c0, 0x154},\r
+    {0x1c3, 0x102},\r
+    {0x1c5, 0x139},\r
+    {0x1c6, 0x106},\r
+    {0x1c8, 0x10c},\r
+    {0x1ca, 0x118},\r
+    {0x1cc, 0x11a},\r
+    {0x1cf, 0x10e},\r
+    {0x1d0, 0x110},\r
+    {0x1d1, 0x143},\r
+    {0x1d2, 0x147},\r
+    {0x1d5, 0x150},\r
+    {0x1d8, 0x158},\r
+    {0x1d9, 0x16e},\r
+    {0x1db, 0x170},\r
+    {0x1de, 0x162},\r
+    {0x1e0, 0x155},\r
+    {0x1e3, 0x103},\r
+    {0x1e5, 0x13a},\r
+    {0x1e6, 0x107},\r
+    {0x1e8, 0x10d},\r
+    {0x1ea, 0x119},\r
+    {0x1ec, 0x11b},\r
+    {0x1ef, 0x10f},\r
+    {0x1f0, 0x111},\r
+    {0x1f1, 0x144},\r
+    {0x1f2, 0x148},\r
+    {0x1f5, 0x151},\r
+    {0x1f8, 0x159},\r
+    {0x1f9, 0x16f},\r
+    {0x1fb, 0x171},\r
+    {0x1fe, 0x163},\r
+    {0x1ff, 0x2d9},\r
+    {0x2a1, 0x126},\r
+    {0x2a6, 0x124},\r
+    {0x2a9, 0x130},\r
+    {0x2ab, 0x11e},\r
+    {0x2ac, 0x134},\r
+    {0x2b1, 0x127},\r
+    {0x2b6, 0x125},\r
+    {0x2b9, 0x131},\r
+    {0x2bb, 0x11f},\r
+    {0x2bc, 0x135},\r
+    {0x2c5, 0x10a},\r
+    {0x2c6, 0x108},\r
+    {0x2d5, 0x120},\r
+    {0x2d8, 0x11c},\r
+    {0x2dd, 0x16c},\r
+    {0x2de, 0x15c},\r
+    {0x2e5, 0x10b},\r
+    {0x2e6, 0x109},\r
+    {0x2f5, 0x121},\r
+    {0x2f8, 0x11d},\r
+    {0x2fd, 0x16d},\r
+    {0x2fe, 0x15d},\r
+    {0x3a2, 0x138},\r
+    {0x3a3, 0x156},\r
+    {0x3a5, 0x128},\r
+    {0x3a6, 0x13b},\r
+    {0x3aa, 0x112},\r
+    {0x3ab, 0x122},\r
+    {0x3ac, 0x166},\r
+    {0x3b3, 0x157},\r
+    {0x3b5, 0x129},\r
+    {0x3b6, 0x13c},\r
+    {0x3ba, 0x113},\r
+    {0x3bb, 0x123},\r
+    {0x3bc, 0x167},\r
+    {0x3bd, 0x14a},\r
+    {0x3bf, 0x14b},\r
+    {0x3c0, 0x100},\r
+    {0x3c7, 0x12e},\r
+    {0x3cc, 0x116},\r
+    {0x3cf, 0x12a},\r
+    {0x3d1, 0x145},\r
+    {0x3d2, 0x14c},\r
+    {0x3d3, 0x136},\r
+    {0x3d9, 0x172},\r
+    {0x3dd, 0x168},\r
+    {0x3de, 0x16a},\r
+    {0x3e0, 0x101},\r
+    {0x3e7, 0x12f},\r
+    {0x3ec, 0x117},\r
+    {0x3ef, 0x12b},\r
+    {0x3f1, 0x146},\r
+    {0x3f2, 0x14d},\r
+    {0x3f3, 0x137},\r
+    {0x3f9, 0x173},\r
+    {0x3fd, 0x169},\r
+    {0x3fe, 0x16b},\r
+    {0x47e, 0x203e},\r
+    {0x4a1, 0x3002},\r
+    {0x4a2, 0x300c},\r
+    {0x4a3, 0x300d},\r
+    {0x4a4, 0x3001},\r
+    {0x4a5, 0x30fb},\r
+    {0x4a6, 0x30f2},\r
+    {0x4a7, 0x30a1},\r
+    {0x4a8, 0x30a3},\r
+    {0x4a9, 0x30a5},\r
+    {0x4aa, 0x30a7},\r
+    {0x4ab, 0x30a9},\r
+    {0x4ac, 0x30e3},\r
+    {0x4ad, 0x30e5},\r
+    {0x4ae, 0x30e7},\r
+    {0x4af, 0x30c3},\r
+    {0x4b0, 0x30fc},\r
+    {0x4b1, 0x30a2},\r
+    {0x4b2, 0x30a4},\r
+    {0x4b3, 0x30a6},\r
+    {0x4b4, 0x30a8},\r
+    {0x4b5, 0x30aa},\r
+    {0x4b6, 0x30ab},\r
+    {0x4b7, 0x30ad},\r
+    {0x4b8, 0x30af},\r
+    {0x4b9, 0x30b1},\r
+    {0x4ba, 0x30b3},\r
+    {0x4bb, 0x30b5},\r
+    {0x4bc, 0x30b7},\r
+    {0x4bd, 0x30b9},\r
+    {0x4be, 0x30bb},\r
+    {0x4bf, 0x30bd},\r
+    {0x4c0, 0x30bf},\r
+    {0x4c1, 0x30c1},\r
+    {0x4c2, 0x30c4},\r
+    {0x4c3, 0x30c6},\r
+    {0x4c4, 0x30c8},\r
+    {0x4c5, 0x30ca},\r
+    {0x4c6, 0x30cb},\r
+    {0x4c7, 0x30cc},\r
+    {0x4c8, 0x30cd},\r
+    {0x4c9, 0x30ce},\r
+    {0x4ca, 0x30cf},\r
+    {0x4cb, 0x30d2},\r
+    {0x4cc, 0x30d5},\r
+    {0x4cd, 0x30d8},\r
+    {0x4ce, 0x30db},\r
+    {0x4cf, 0x30de},\r
+    {0x4d0, 0x30df},\r
+    {0x4d1, 0x30e0},\r
+    {0x4d2, 0x30e1},\r
+    {0x4d3, 0x30e2},\r
+    {0x4d4, 0x30e4},\r
+    {0x4d5, 0x30e6},\r
+    {0x4d6, 0x30e8},\r
+    {0x4d7, 0x30e9},\r
+    {0x4d8, 0x30ea},\r
+    {0x4d9, 0x30eb},\r
+    {0x4da, 0x30ec},\r
+    {0x4db, 0x30ed},\r
+    {0x4dc, 0x30ef},\r
+    {0x4dd, 0x30f3},\r
+    {0x4de, 0x309b},\r
+    {0x4df, 0x309c},\r
+    {0x5ac, 0x60c},\r
+    {0x5bb, 0x61b},\r
+    {0x5bf, 0x61f},\r
+    {0x5c1, 0x621},\r
+    {0x5c2, 0x622},\r
+    {0x5c3, 0x623},\r
+    {0x5c4, 0x624},\r
+    {0x5c5, 0x625},\r
+    {0x5c6, 0x626},\r
+    {0x5c7, 0x627},\r
+    {0x5c8, 0x628},\r
+    {0x5c9, 0x629},\r
+    {0x5ca, 0x62a},\r
+    {0x5cb, 0x62b},\r
+    {0x5cc, 0x62c},\r
+    {0x5cd, 0x62d},\r
+    {0x5ce, 0x62e},\r
+    {0x5cf, 0x62f},\r
+    {0x5d0, 0x630},\r
+    {0x5d1, 0x631},\r
+    {0x5d2, 0x632},\r
+    {0x5d3, 0x633},\r
+    {0x5d4, 0x634},\r
+    {0x5d5, 0x635},\r
+    {0x5d6, 0x636},\r
+    {0x5d7, 0x637},\r
+    {0x5d8, 0x638},\r
+    {0x5d9, 0x639},\r
+    {0x5da, 0x63a},\r
+    {0x5e0, 0x640},\r
+    {0x5e1, 0x641},\r
+    {0x5e2, 0x642},\r
+    {0x5e3, 0x643},\r
+    {0x5e4, 0x644},\r
+    {0x5e5, 0x645},\r
+    {0x5e6, 0x646},\r
+    {0x5e7, 0x647},\r
+    {0x5e8, 0x648},\r
+    {0x5e9, 0x649},\r
+    {0x5ea, 0x64a},\r
+    {0x5eb, 0x64b},\r
+    {0x5ec, 0x64c},\r
+    {0x5ed, 0x64d},\r
+    {0x5ee, 0x64e},\r
+    {0x5ef, 0x64f},\r
+    {0x5f0, 0x650},\r
+    {0x5f1, 0x651},\r
+    {0x5f2, 0x652},\r
+    {0x6a1, 0x452},\r
+    {0x6a2, 0x453},\r
+    {0x6a3, 0x451},\r
+    {0x6a4, 0x454},\r
+    {0x6a5, 0x455},\r
+    {0x6a6, 0x456},\r
+    {0x6a7, 0x457},\r
+    {0x6a8, 0x458},\r
+    {0x6a9, 0x459},\r
+    {0x6aa, 0x45a},\r
+    {0x6ab, 0x45b},\r
+    {0x6ac, 0x45c},\r
+    {0x6ae, 0x45e},\r
+    {0x6af, 0x45f},\r
+    {0x6b0, 0x2116},\r
+    {0x6b1, 0x402},\r
+    {0x6b2, 0x403},\r
+    {0x6b3, 0x401},\r
+    {0x6b4, 0x404},\r
+    {0x6b5, 0x405},\r
+    {0x6b6, 0x406},\r
+    {0x6b7, 0x407},\r
+    {0x6b8, 0x408},\r
+    {0x6b9, 0x409},\r
+    {0x6ba, 0x40a},\r
+    {0x6bb, 0x40b},\r
+    {0x6bc, 0x40c},\r
+    {0x6be, 0x40e},\r
+    {0x6bf, 0x40f},\r
+    {0x6c0, 0x44e},\r
+    {0x6c1, 0x430},\r
+    {0x6c2, 0x431},\r
+    {0x6c3, 0x446},\r
+    {0x6c4, 0x434},\r
+    {0x6c5, 0x435},\r
+    {0x6c6, 0x444},\r
+    {0x6c7, 0x433},\r
+    {0x6c8, 0x445},\r
+    {0x6c9, 0x438},\r
+    {0x6ca, 0x439},\r
+    {0x6cb, 0x43a},\r
+    {0x6cc, 0x43b},\r
+    {0x6cd, 0x43c},\r
+    {0x6ce, 0x43d},\r
+    {0x6cf, 0x43e},\r
+    {0x6d0, 0x43f},\r
+    {0x6d1, 0x44f},\r
+    {0x6d2, 0x440},\r
+    {0x6d3, 0x441},\r
+    {0x6d4, 0x442},\r
+    {0x6d5, 0x443},\r
+    {0x6d6, 0x436},\r
+    {0x6d7, 0x432},\r
+    {0x6d8, 0x44c},\r
+    {0x6d9, 0x44b},\r
+    {0x6da, 0x437},\r
+    {0x6db, 0x448},\r
+    {0x6dc, 0x44d},\r
+    {0x6dd, 0x449},\r
+    {0x6de, 0x447},\r
+    {0x6df, 0x44a},\r
+    {0x6e0, 0x42e},\r
+    {0x6e1, 0x410},\r
+    {0x6e2, 0x411},\r
+    {0x6e3, 0x426},\r
+    {0x6e4, 0x414},\r
+    {0x6e5, 0x415},\r
+    {0x6e6, 0x424},\r
+    {0x6e7, 0x413},\r
+    {0x6e8, 0x425},\r
+    {0x6e9, 0x418},\r
+    {0x6ea, 0x419},\r
+    {0x6eb, 0x41a},\r
+    {0x6ec, 0x41b},\r
+    {0x6ed, 0x41c},\r
+    {0x6ee, 0x41d},\r
+    {0x6ef, 0x41e},\r
+    {0x6f0, 0x41f},\r
+    {0x6f1, 0x42f},\r
+    {0x6f2, 0x420},\r
+    {0x6f3, 0x421},\r
+    {0x6f4, 0x422},\r
+    {0x6f5, 0x423},\r
+    {0x6f6, 0x416},\r
+    {0x6f7, 0x412},\r
+    {0x6f8, 0x42c},\r
+    {0x6f9, 0x42b},\r
+    {0x6fa, 0x417},\r
+    {0x6fb, 0x428},\r
+    {0x6fc, 0x42d},\r
+    {0x6fd, 0x429},\r
+    {0x6fe, 0x427},\r
+    {0x6ff, 0x42a},\r
+    {0x7a1, 0x386},\r
+    {0x7a2, 0x388},\r
+    {0x7a3, 0x389},\r
+    {0x7a4, 0x38a},\r
+    {0x7a5, 0x3aa},\r
+    {0x7a7, 0x38c},\r
+    {0x7a8, 0x38e},\r
+    {0x7a9, 0x3ab},\r
+    {0x7ab, 0x38f},\r
+    {0x7ae, 0x385},\r
+    {0x7af, 0x2015},\r
+    {0x7b1, 0x3ac},\r
+    {0x7b2, 0x3ad},\r
+    {0x7b3, 0x3ae},\r
+    {0x7b4, 0x3af},\r
+    {0x7b5, 0x3ca},\r
+    {0x7b6, 0x390},\r
+    {0x7b7, 0x3cc},\r
+    {0x7b8, 0x3cd},\r
+    {0x7b9, 0x3cb},\r
+    {0x7ba, 0x3b0},\r
+    {0x7bb, 0x3ce},\r
+    {0x7c1, 0x391},\r
+    {0x7c2, 0x392},\r
+    {0x7c3, 0x393},\r
+    {0x7c4, 0x394},\r
+    {0x7c5, 0x395},\r
+    {0x7c6, 0x396},\r
+    {0x7c7, 0x397},\r
+    {0x7c8, 0x398},\r
+    {0x7c9, 0x399},\r
+    {0x7ca, 0x39a},\r
+    {0x7cb, 0x39b},\r
+    {0x7cc, 0x39c},\r
+    {0x7cd, 0x39d},\r
+    {0x7ce, 0x39e},\r
+    {0x7cf, 0x39f},\r
+    {0x7d0, 0x3a0},\r
+    {0x7d1, 0x3a1},\r
+    {0x7d2, 0x3a3},\r
+    {0x7d4, 0x3a4},\r
+    {0x7d5, 0x3a5},\r
+    {0x7d6, 0x3a6},\r
+    {0x7d7, 0x3a7},\r
+    {0x7d8, 0x3a8},\r
+    {0x7d9, 0x3a9},\r
+    {0x7e1, 0x3b1},\r
+    {0x7e2, 0x3b2},\r
+    {0x7e3, 0x3b3},\r
+    {0x7e4, 0x3b4},\r
+    {0x7e5, 0x3b5},\r
+    {0x7e6, 0x3b6},\r
+    {0x7e7, 0x3b7},\r
+    {0x7e8, 0x3b8},\r
+    {0x7e9, 0x3b9},\r
+    {0x7ea, 0x3ba},\r
+    {0x7eb, 0x3bb},\r
+    {0x7ec, 0x3bc},\r
+    {0x7ed, 0x3bd},\r
+    {0x7ee, 0x3be},\r
+    {0x7ef, 0x3bf},\r
+    {0x7f0, 0x3c0},\r
+    {0x7f1, 0x3c1},\r
+    {0x7f2, 0x3c3},\r
+    {0x7f3, 0x3c2},\r
+    {0x7f4, 0x3c4},\r
+    {0x7f5, 0x3c5},\r
+    {0x7f6, 0x3c6},\r
+    {0x7f7, 0x3c7},\r
+    {0x7f8, 0x3c8},\r
+    {0x7f9, 0x3c9},\r
+    {0x8a1, 0x23b7},\r
+    {0x8a2, 0x250c},\r
+    {0x8a3, 0x2500},\r
+    {0x8a4, 0x2320},\r
+    {0x8a5, 0x2321},\r
+    {0x8a6, 0x2502},\r
+    {0x8a7, 0x23a1},\r
+    {0x8a8, 0x23a3},\r
+    {0x8a9, 0x23a4},\r
+    {0x8aa, 0x23a6},\r
+    {0x8ab, 0x239b},\r
+    {0x8ac, 0x239d},\r
+    {0x8ad, 0x239e},\r
+    {0x8ae, 0x23a0},\r
+    {0x8af, 0x23a8},\r
+    {0x8b0, 0x23ac},\r
+    {0x8bc, 0x2264},\r
+    {0x8bd, 0x2260},\r
+    {0x8be, 0x2265},\r
+    {0x8bf, 0x222b},\r
+    {0x8c0, 0x2234},\r
+    {0x8c1, 0x221d},\r
+    {0x8c2, 0x221e},\r
+    {0x8c5, 0x2207},\r
+    {0x8c8, 0x223c},\r
+    {0x8c9, 0x2243},\r
+    {0x8cd, 0x21d4},\r
+    {0x8ce, 0x21d2},\r
+    {0x8cf, 0x2261},\r
+    {0x8d6, 0x221a},\r
+    {0x8da, 0x2282},\r
+    {0x8db, 0x2283},\r
+    {0x8dc, 0x2229},\r
+    {0x8dd, 0x222a},\r
+    {0x8de, 0x2227},\r
+    {0x8df, 0x2228},\r
+    {0x8ef, 0x2202},\r
+    {0x8f6, 0x192},\r
+    {0x8fb, 0x2190},\r
+    {0x8fc, 0x2191},\r
+    {0x8fd, 0x2192},\r
+    {0x8fe, 0x2193},\r
+    {0x9e0, 0x25c6},\r
+    {0x9e1, 0x2592},\r
+    {0x9e2, 0x2409},\r
+    {0x9e3, 0x240c},\r
+    {0x9e4, 0x240d},\r
+    {0x9e5, 0x240a},\r
+    {0x9e8, 0x2424},\r
+    {0x9e9, 0x240b},\r
+    {0x9ea, 0x2518},\r
+    {0x9eb, 0x2510},\r
+    {0x9ec, 0x250c},\r
+    {0x9ed, 0x2514},\r
+    {0x9ee, 0x253c},\r
+    {0x9ef, 0x23ba},\r
+    {0x9f0, 0x23bb},\r
+    {0x9f1, 0x2500},\r
+    {0x9f2, 0x23bc},\r
+    {0x9f3, 0x23bd},\r
+    {0x9f4, 0x251c},\r
+    {0x9f5, 0x2524},\r
+    {0x9f6, 0x2534},\r
+    {0x9f7, 0x252c},\r
+    {0x9f8, 0x2502},\r
+    {0xaa1, 0x2003},\r
+    {0xaa2, 0x2002},\r
+    {0xaa3, 0x2004},\r
+    {0xaa4, 0x2005},\r
+    {0xaa5, 0x2007},\r
+    {0xaa6, 0x2008},\r
+    {0xaa7, 0x2009},\r
+    {0xaa8, 0x200a},\r
+    {0xaa9, 0x2014},\r
+    {0xaaa, 0x2013},\r
+    {0xaae, 0x2026},\r
+    {0xaaf, 0x2025},\r
+    {0xab0, 0x2153},\r
+    {0xab1, 0x2154},\r
+    {0xab2, 0x2155},\r
+    {0xab3, 0x2156},\r
+    {0xab4, 0x2157},\r
+    {0xab5, 0x2158},\r
+    {0xab6, 0x2159},\r
+    {0xab7, 0x215a},\r
+    {0xab8, 0x2105},\r
+    {0xabb, 0x2012},\r
+    {0xabc, 0x2329},\r
+    {0xabe, 0x232a},\r
+    {0xac3, 0x215b},\r
+    {0xac4, 0x215c},\r
+    {0xac5, 0x215d},\r
+    {0xac6, 0x215e},\r
+    {0xac9, 0x2122},\r
+    {0xaca, 0x2613},\r
+    {0xacc, 0x25c1},\r
+    {0xacd, 0x25b7},\r
+    {0xace, 0x25cb},\r
+    {0xacf, 0x25af},\r
+    {0xad0, 0x2018},\r
+    {0xad1, 0x2019},\r
+    {0xad2, 0x201c},\r
+    {0xad3, 0x201d},\r
+    {0xad4, 0x211e},\r
+    {0xad6, 0x2032},\r
+    {0xad7, 0x2033},\r
+    {0xad9, 0x271d},\r
+    {0xadb, 0x25ac},\r
+    {0xadc, 0x25c0},\r
+    {0xadd, 0x25b6},\r
+    {0xade, 0x25cf},\r
+    {0xadf, 0x25ae},\r
+    {0xae0, 0x25e6},\r
+    {0xae1, 0x25ab},\r
+    {0xae2, 0x25ad},\r
+    {0xae3, 0x25b3},\r
+    {0xae4, 0x25bd},\r
+    {0xae5, 0x2606},\r
+    {0xae6, 0x2022},\r
+    {0xae7, 0x25aa},\r
+    {0xae8, 0x25b2},\r
+    {0xae9, 0x25bc},\r
+    {0xaea, 0x261c},\r
+    {0xaeb, 0x261e},\r
+    {0xaec, 0x2663},\r
+    {0xaed, 0x2666},\r
+    {0xaee, 0x2665},\r
+    {0xaf0, 0x2720},\r
+    {0xaf1, 0x2020},\r
+    {0xaf2, 0x2021},\r
+    {0xaf3, 0x2713},\r
+    {0xaf4, 0x2717},\r
+    {0xaf5, 0x266f},\r
+    {0xaf6, 0x266d},\r
+    {0xaf7, 0x2642},\r
+    {0xaf8, 0x2640},\r
+    {0xaf9, 0x260e},\r
+    {0xafa, 0x2315},\r
+    {0xafb, 0x2117},\r
+    {0xafc, 0x2038},\r
+    {0xafd, 0x201a},\r
+    {0xafe, 0x201e},\r
+    {0xba3, 0x3c},\r
+    {0xba6, 0x3e},\r
+    {0xba8, 0x2228},\r
+    {0xba9, 0x2227},\r
+    {0xbc0, 0xaf},\r
+    {0xbc2, 0x22a5},\r
+    {0xbc3, 0x2229},\r
+    {0xbc4, 0x230a},\r
+    {0xbc6, 0x5f},\r
+    {0xbca, 0x2218},\r
+    {0xbcc, 0x2395},\r
+    {0xbce, 0x22a4},\r
+    {0xbcf, 0x25cb},\r
+    {0xbd3, 0x2308},\r
+    {0xbd6, 0x222a},\r
+    {0xbd8, 0x2283},\r
+    {0xbda, 0x2282},\r
+    {0xbdc, 0x22a2},\r
+    {0xbfc, 0x22a3},\r
+    {0xcdf, 0x2017},\r
+    {0xce0, 0x5d0},\r
+    {0xce1, 0x5d1},\r
+    {0xce2, 0x5d2},\r
+    {0xce3, 0x5d3},\r
+    {0xce4, 0x5d4},\r
+    {0xce5, 0x5d5},\r
+    {0xce6, 0x5d6},\r
+    {0xce7, 0x5d7},\r
+    {0xce8, 0x5d8},\r
+    {0xce9, 0x5d9},\r
+    {0xcea, 0x5da},\r
+    {0xceb, 0x5db},\r
+    {0xcec, 0x5dc},\r
+    {0xced, 0x5dd},\r
+    {0xcee, 0x5de},\r
+    {0xcef, 0x5df},\r
+    {0xcf0, 0x5e0},\r
+    {0xcf1, 0x5e1},\r
+    {0xcf2, 0x5e2},\r
+    {0xcf3, 0x5e3},\r
+    {0xcf4, 0x5e4},\r
+    {0xcf5, 0x5e5},\r
+    {0xcf6, 0x5e6},\r
+    {0xcf7, 0x5e7},\r
+    {0xcf8, 0x5e8},\r
+    {0xcf9, 0x5e9},\r
+    {0xcfa, 0x5ea},\r
+    {0xda1, 0xe01},\r
+    {0xda2, 0xe02},\r
+    {0xda3, 0xe03},\r
+    {0xda4, 0xe04},\r
+    {0xda5, 0xe05},\r
+    {0xda6, 0xe06},\r
+    {0xda7, 0xe07},\r
+    {0xda8, 0xe08},\r
+    {0xda9, 0xe09},\r
+    {0xdaa, 0xe0a},\r
+    {0xdab, 0xe0b},\r
+    {0xdac, 0xe0c},\r
+    {0xdad, 0xe0d},\r
+    {0xdae, 0xe0e},\r
+    {0xdaf, 0xe0f},\r
+    {0xdb0, 0xe10},\r
+    {0xdb1, 0xe11},\r
+    {0xdb2, 0xe12},\r
+    {0xdb3, 0xe13},\r
+    {0xdb4, 0xe14},\r
+    {0xdb5, 0xe15},\r
+    {0xdb6, 0xe16},\r
+    {0xdb7, 0xe17},\r
+    {0xdb8, 0xe18},\r
+    {0xdb9, 0xe19},\r
+    {0xdba, 0xe1a},\r
+    {0xdbb, 0xe1b},\r
+    {0xdbc, 0xe1c},\r
+    {0xdbd, 0xe1d},\r
+    {0xdbe, 0xe1e},\r
+    {0xdbf, 0xe1f},\r
+    {0xdc0, 0xe20},\r
+    {0xdc1, 0xe21},\r
+    {0xdc2, 0xe22},\r
+    {0xdc3, 0xe23},\r
+    {0xdc4, 0xe24},\r
+    {0xdc5, 0xe25},\r
+    {0xdc6, 0xe26},\r
+    {0xdc7, 0xe27},\r
+    {0xdc8, 0xe28},\r
+    {0xdc9, 0xe29},\r
+    {0xdca, 0xe2a},\r
+    {0xdcb, 0xe2b},\r
+    {0xdcc, 0xe2c},\r
+    {0xdcd, 0xe2d},\r
+    {0xdce, 0xe2e},\r
+    {0xdcf, 0xe2f},\r
+    {0xdd0, 0xe30},\r
+    {0xdd1, 0xe31},\r
+    {0xdd2, 0xe32},\r
+    {0xdd3, 0xe33},\r
+    {0xdd4, 0xe34},\r
+    {0xdd5, 0xe35},\r
+    {0xdd6, 0xe36},\r
+    {0xdd7, 0xe37},\r
+    {0xdd8, 0xe38},\r
+    {0xdd9, 0xe39},\r
+    {0xdda, 0xe3a},\r
+    {0xddf, 0xe3f},\r
+    {0xde0, 0xe40},\r
+    {0xde1, 0xe41},\r
+    {0xde2, 0xe42},\r
+    {0xde3, 0xe43},\r
+    {0xde4, 0xe44},\r
+    {0xde5, 0xe45},\r
+    {0xde6, 0xe46},\r
+    {0xde7, 0xe47},\r
+    {0xde8, 0xe48},\r
+    {0xde9, 0xe49},\r
+    {0xdea, 0xe4a},\r
+    {0xdeb, 0xe4b},\r
+    {0xdec, 0xe4c},\r
+    {0xded, 0xe4d},\r
+    {0xdf0, 0xe50},\r
+    {0xdf1, 0xe51},\r
+    {0xdf2, 0xe52},\r
+    {0xdf3, 0xe53},\r
+    {0xdf4, 0xe54},\r
+    {0xdf5, 0xe55},\r
+    {0xdf6, 0xe56},\r
+    {0xdf7, 0xe57},\r
+    {0xdf8, 0xe58},\r
+    {0xdf9, 0xe59},\r
+    {0xea1, 0x3131},\r
+    {0xea2, 0x3132},\r
+    {0xea3, 0x3133},\r
+    {0xea4, 0x3134},\r
+    {0xea5, 0x3135},\r
+    {0xea6, 0x3136},\r
+    {0xea7, 0x3137},\r
+    {0xea8, 0x3138},\r
+    {0xea9, 0x3139},\r
+    {0xeaa, 0x313a},\r
+    {0xeab, 0x313b},\r
+    {0xeac, 0x313c},\r
+    {0xead, 0x313d},\r
+    {0xeae, 0x313e},\r
+    {0xeaf, 0x313f},\r
+    {0xeb0, 0x3140},\r
+    {0xeb1, 0x3141},\r
+    {0xeb2, 0x3142},\r
+    {0xeb3, 0x3143},\r
+    {0xeb4, 0x3144},\r
+    {0xeb5, 0x3145},\r
+    {0xeb6, 0x3146},\r
+    {0xeb7, 0x3147},\r
+    {0xeb8, 0x3148},\r
+    {0xeb9, 0x3149},\r
+    {0xeba, 0x314a},\r
+    {0xebb, 0x314b},\r
+    {0xebc, 0x314c},\r
+    {0xebd, 0x314d},\r
+    {0xebe, 0x314e},\r
+    {0xebf, 0x314f},\r
+    {0xec0, 0x3150},\r
+    {0xec1, 0x3151},\r
+    {0xec2, 0x3152},\r
+    {0xec3, 0x3153},\r
+    {0xec4, 0x3154},\r
+    {0xec5, 0x3155},\r
+    {0xec6, 0x3156},\r
+    {0xec7, 0x3157},\r
+    {0xec8, 0x3158},\r
+    {0xec9, 0x3159},\r
+    {0xeca, 0x315a},\r
+    {0xecb, 0x315b},\r
+    {0xecc, 0x315c},\r
+    {0xecd, 0x315d},\r
+    {0xece, 0x315e},\r
+    {0xecf, 0x315f},\r
+    {0xed0, 0x3160},\r
+    {0xed1, 0x3161},\r
+    {0xed2, 0x3162},\r
+    {0xed3, 0x3163},\r
+    {0xed4, 0x11a8},\r
+    {0xed5, 0x11a9},\r
+    {0xed6, 0x11aa},\r
+    {0xed7, 0x11ab},\r
+    {0xed8, 0x11ac},\r
+    {0xed9, 0x11ad},\r
+    {0xeda, 0x11ae},\r
+    {0xedb, 0x11af},\r
+    {0xedc, 0x11b0},\r
+    {0xedd, 0x11b1},\r
+    {0xede, 0x11b2},\r
+    {0xedf, 0x11b3},\r
+    {0xee0, 0x11b4},\r
+    {0xee1, 0x11b5},\r
+    {0xee2, 0x11b6},\r
+    {0xee3, 0x11b7},\r
+    {0xee4, 0x11b8},\r
+    {0xee5, 0x11b9},\r
+    {0xee6, 0x11ba},\r
+    {0xee7, 0x11bb},\r
+    {0xee8, 0x11bc},\r
+    {0xee9, 0x11bd},\r
+    {0xeea, 0x11be},\r
+    {0xeeb, 0x11bf},\r
+    {0xeec, 0x11c0},\r
+    {0xeed, 0x11c1},\r
+    {0xeee, 0x11c2},\r
+    {0xeef, 0x316d},\r
+    {0xef0, 0x3171},\r
+    {0xef1, 0x3178},\r
+    {0xef2, 0x317f},\r
+    {0xef3, 0x3181},\r
+    {0xef4, 0x3184},\r
+    {0xef5, 0x3186},\r
+    {0xef6, 0x318d},\r
+    {0xef7, 0x318e},\r
+    {0xef8, 0x11eb},\r
+    {0xef9, 0x11f0},\r
+    {0xefa, 0x11f9},\r
+    {0xeff, 0x20a9},\r
+    {0x13a4, 0x20ac},\r
+    {0x13bc, 0x152},\r
+    {0x13bd, 0x153},\r
+    {0x13be, 0x178},\r
+    {0x20a0, 0x20a0},\r
+    {0x20a1, 0x20a1},\r
+    {0x20a2, 0x20a2},\r
+    {0x20a3, 0x20a3},\r
+    {0x20a4, 0x20a4},\r
+    {0x20a5, 0x20a5},\r
+    {0x20a6, 0x20a6},\r
+    {0x20a7, 0x20a7},\r
+    {0x20a8, 0x20a8},\r
+    {0x20aa, 0x20aa},\r
+    {0x20ab, 0x20ab},\r
+    {0x20ac, 0x20ac},\r
+};\r
+\r
+int keysym_to_unicode(int keysym)\r
+{\r
+    int i, j, k;\r
+\r
+    i = -1;\r
+    j = lenof(keysyms);\r
+\r
+    while (j - i >= 2) {\r
+       k = (j + i) / 2;\r
+       if (keysyms[k].keysym == keysym)\r
+           return keysyms[k].unicode;\r
+       else if (keysyms[k].keysym < keysym)\r
+           i = k;\r
+       else\r
+           j = k;\r
+    }\r
+    return -1;\r
+}\r