18b8c0daaSLinus Torvalds /*
28b8c0daaSLinus Torvalds * linux/fs/nls/mac-cyrillic.c
38b8c0daaSLinus Torvalds *
48b8c0daaSLinus Torvalds * Charset maccyrillic translation tables.
58b8c0daaSLinus Torvalds * Generated automatically from the Unicode and charset
68b8c0daaSLinus Torvalds * tables from the Unicode Organization (www.unicode.org).
78b8c0daaSLinus Torvalds * The Unicode to charset table has only exact mappings.
88b8c0daaSLinus Torvalds */
98b8c0daaSLinus Torvalds
108b8c0daaSLinus Torvalds /*
118b8c0daaSLinus Torvalds * COPYRIGHT AND PERMISSION NOTICE
128b8c0daaSLinus Torvalds *
138b8c0daaSLinus Torvalds * Copyright 1991-2012 Unicode, Inc. All rights reserved. Distributed under
148b8c0daaSLinus Torvalds * the Terms of Use in http://www.unicode.org/copyright.html.
158b8c0daaSLinus Torvalds *
168b8c0daaSLinus Torvalds * Permission is hereby granted, free of charge, to any person obtaining a
178b8c0daaSLinus Torvalds * copy of the Unicode data files and any associated documentation (the "Data
188b8c0daaSLinus Torvalds * Files") or Unicode software and any associated documentation (the
198b8c0daaSLinus Torvalds * "Software") to deal in the Data Files or Software without restriction,
208b8c0daaSLinus Torvalds * including without limitation the rights to use, copy, modify, merge,
218b8c0daaSLinus Torvalds * publish, distribute, and/or sell copies of the Data Files or Software, and
228b8c0daaSLinus Torvalds * to permit persons to whom the Data Files or Software are furnished to do
238b8c0daaSLinus Torvalds * so, provided that (a) the above copyright notice(s) and this permission
248b8c0daaSLinus Torvalds * notice appear with all copies of the Data Files or Software, (b) both the
258b8c0daaSLinus Torvalds * above copyright notice(s) and this permission notice appear in associated
268b8c0daaSLinus Torvalds * documentation, and (c) there is clear notice in each modified Data File or
278b8c0daaSLinus Torvalds * in the Software as well as in the documentation associated with the Data
288b8c0daaSLinus Torvalds * File(s) or Software that the data or software has been modified.
298b8c0daaSLinus Torvalds *
308b8c0daaSLinus Torvalds * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
318b8c0daaSLinus Torvalds * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
328b8c0daaSLinus Torvalds * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
338b8c0daaSLinus Torvalds * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
348b8c0daaSLinus Torvalds * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
358b8c0daaSLinus Torvalds * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
368b8c0daaSLinus Torvalds * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
378b8c0daaSLinus Torvalds * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
388b8c0daaSLinus Torvalds * PERFORMANCE OF THE DATA FILES OR SOFTWARE.
398b8c0daaSLinus Torvalds *
408b8c0daaSLinus Torvalds * Except as contained in this notice, the name of a copyright holder shall
418b8c0daaSLinus Torvalds * not be used in advertising or otherwise to promote the sale, use or other
428b8c0daaSLinus Torvalds * dealings in these Data Files or Software without prior written
438b8c0daaSLinus Torvalds * authorization of the copyright holder.
448b8c0daaSLinus Torvalds */
458b8c0daaSLinus Torvalds
468b8c0daaSLinus Torvalds #include <linux/module.h>
478b8c0daaSLinus Torvalds #include <linux/kernel.h>
488b8c0daaSLinus Torvalds #include <linux/string.h>
498b8c0daaSLinus Torvalds #include <linux/nls.h>
508b8c0daaSLinus Torvalds #include <linux/errno.h>
518b8c0daaSLinus Torvalds
528b8c0daaSLinus Torvalds static const wchar_t charset2uni[256] = {
538b8c0daaSLinus Torvalds /* 0x00 */
548b8c0daaSLinus Torvalds 0x0000, 0x0001, 0x0002, 0x0003,
558b8c0daaSLinus Torvalds 0x0004, 0x0005, 0x0006, 0x0007,
568b8c0daaSLinus Torvalds 0x0008, 0x0009, 0x000a, 0x000b,
578b8c0daaSLinus Torvalds 0x000c, 0x000d, 0x000e, 0x000f,
588b8c0daaSLinus Torvalds /* 0x10 */
598b8c0daaSLinus Torvalds 0x0010, 0x0011, 0x0012, 0x0013,
608b8c0daaSLinus Torvalds 0x0014, 0x0015, 0x0016, 0x0017,
618b8c0daaSLinus Torvalds 0x0018, 0x0019, 0x001a, 0x001b,
628b8c0daaSLinus Torvalds 0x001c, 0x001d, 0x001e, 0x001f,
638b8c0daaSLinus Torvalds /* 0x20 */
648b8c0daaSLinus Torvalds 0x0020, 0x0021, 0x0022, 0x0023,
658b8c0daaSLinus Torvalds 0x0024, 0x0025, 0x0026, 0x0027,
668b8c0daaSLinus Torvalds 0x0028, 0x0029, 0x002a, 0x002b,
678b8c0daaSLinus Torvalds 0x002c, 0x002d, 0x002e, 0x002f,
688b8c0daaSLinus Torvalds /* 0x30 */
698b8c0daaSLinus Torvalds 0x0030, 0x0031, 0x0032, 0x0033,
708b8c0daaSLinus Torvalds 0x0034, 0x0035, 0x0036, 0x0037,
718b8c0daaSLinus Torvalds 0x0038, 0x0039, 0x003a, 0x003b,
728b8c0daaSLinus Torvalds 0x003c, 0x003d, 0x003e, 0x003f,
738b8c0daaSLinus Torvalds /* 0x40 */
748b8c0daaSLinus Torvalds 0x0040, 0x0041, 0x0042, 0x0043,
758b8c0daaSLinus Torvalds 0x0044, 0x0045, 0x0046, 0x0047,
768b8c0daaSLinus Torvalds 0x0048, 0x0049, 0x004a, 0x004b,
778b8c0daaSLinus Torvalds 0x004c, 0x004d, 0x004e, 0x004f,
788b8c0daaSLinus Torvalds /* 0x50 */
798b8c0daaSLinus Torvalds 0x0050, 0x0051, 0x0052, 0x0053,
808b8c0daaSLinus Torvalds 0x0054, 0x0055, 0x0056, 0x0057,
818b8c0daaSLinus Torvalds 0x0058, 0x0059, 0x005a, 0x005b,
828b8c0daaSLinus Torvalds 0x005c, 0x005d, 0x005e, 0x005f,
838b8c0daaSLinus Torvalds /* 0x60 */
848b8c0daaSLinus Torvalds 0x0060, 0x0061, 0x0062, 0x0063,
858b8c0daaSLinus Torvalds 0x0064, 0x0065, 0x0066, 0x0067,
868b8c0daaSLinus Torvalds 0x0068, 0x0069, 0x006a, 0x006b,
878b8c0daaSLinus Torvalds 0x006c, 0x006d, 0x006e, 0x006f,
888b8c0daaSLinus Torvalds /* 0x70 */
898b8c0daaSLinus Torvalds 0x0070, 0x0071, 0x0072, 0x0073,
908b8c0daaSLinus Torvalds 0x0074, 0x0075, 0x0076, 0x0077,
918b8c0daaSLinus Torvalds 0x0078, 0x0079, 0x007a, 0x007b,
928b8c0daaSLinus Torvalds 0x007c, 0x007d, 0x007e, 0x007f,
938b8c0daaSLinus Torvalds /* 0x80 */
948b8c0daaSLinus Torvalds 0x0410, 0x0411, 0x0412, 0x0413,
958b8c0daaSLinus Torvalds 0x0414, 0x0415, 0x0416, 0x0417,
968b8c0daaSLinus Torvalds 0x0418, 0x0419, 0x041a, 0x041b,
978b8c0daaSLinus Torvalds 0x041c, 0x041d, 0x041e, 0x041f,
988b8c0daaSLinus Torvalds /* 0x90 */
998b8c0daaSLinus Torvalds 0x0420, 0x0421, 0x0422, 0x0423,
1008b8c0daaSLinus Torvalds 0x0424, 0x0425, 0x0426, 0x0427,
1018b8c0daaSLinus Torvalds 0x0428, 0x0429, 0x042a, 0x042b,
1028b8c0daaSLinus Torvalds 0x042c, 0x042d, 0x042e, 0x042f,
1038b8c0daaSLinus Torvalds /* 0xa0 */
1048b8c0daaSLinus Torvalds 0x2020, 0x00b0, 0x0490, 0x00a3,
1058b8c0daaSLinus Torvalds 0x00a7, 0x2022, 0x00b6, 0x0406,
1068b8c0daaSLinus Torvalds 0x00ae, 0x00a9, 0x2122, 0x0402,
1078b8c0daaSLinus Torvalds 0x0452, 0x2260, 0x0403, 0x0453,
1088b8c0daaSLinus Torvalds /* 0xb0 */
1098b8c0daaSLinus Torvalds 0x221e, 0x00b1, 0x2264, 0x2265,
1108b8c0daaSLinus Torvalds 0x0456, 0x00b5, 0x0491, 0x0408,
1118b8c0daaSLinus Torvalds 0x0404, 0x0454, 0x0407, 0x0457,
1128b8c0daaSLinus Torvalds 0x0409, 0x0459, 0x040a, 0x045a,
1138b8c0daaSLinus Torvalds /* 0xc0 */
1148b8c0daaSLinus Torvalds 0x0458, 0x0405, 0x00ac, 0x221a,
1158b8c0daaSLinus Torvalds 0x0192, 0x2248, 0x2206, 0x00ab,
1168b8c0daaSLinus Torvalds 0x00bb, 0x2026, 0x00a0, 0x040b,
1178b8c0daaSLinus Torvalds 0x045b, 0x040c, 0x045c, 0x0455,
1188b8c0daaSLinus Torvalds /* 0xd0 */
1198b8c0daaSLinus Torvalds 0x2013, 0x2014, 0x201c, 0x201d,
1208b8c0daaSLinus Torvalds 0x2018, 0x2019, 0x00f7, 0x201e,
1218b8c0daaSLinus Torvalds 0x040e, 0x045e, 0x040f, 0x045f,
1228b8c0daaSLinus Torvalds 0x2116, 0x0401, 0x0451, 0x044f,
1238b8c0daaSLinus Torvalds /* 0xe0 */
1248b8c0daaSLinus Torvalds 0x0430, 0x0431, 0x0432, 0x0433,
1258b8c0daaSLinus Torvalds 0x0434, 0x0435, 0x0436, 0x0437,
1268b8c0daaSLinus Torvalds 0x0438, 0x0439, 0x043a, 0x043b,
1278b8c0daaSLinus Torvalds 0x043c, 0x043d, 0x043e, 0x043f,
1288b8c0daaSLinus Torvalds /* 0xf0 */
1298b8c0daaSLinus Torvalds 0x0440, 0x0441, 0x0442, 0x0443,
1308b8c0daaSLinus Torvalds 0x0444, 0x0445, 0x0446, 0x0447,
1318b8c0daaSLinus Torvalds 0x0448, 0x0449, 0x044a, 0x044b,
1328b8c0daaSLinus Torvalds 0x044c, 0x044d, 0x044e, 0x20ac,
1338b8c0daaSLinus Torvalds };
1348b8c0daaSLinus Torvalds
1358b8c0daaSLinus Torvalds static const unsigned char page00[256] = {
1368b8c0daaSLinus Torvalds 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
1378b8c0daaSLinus Torvalds 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
1388b8c0daaSLinus Torvalds 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
1398b8c0daaSLinus Torvalds 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
1408b8c0daaSLinus Torvalds 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
1418b8c0daaSLinus Torvalds 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
1428b8c0daaSLinus Torvalds 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
1438b8c0daaSLinus Torvalds 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
1448b8c0daaSLinus Torvalds 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
1458b8c0daaSLinus Torvalds 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
1468b8c0daaSLinus Torvalds 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
1478b8c0daaSLinus Torvalds 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
1488b8c0daaSLinus Torvalds 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
1498b8c0daaSLinus Torvalds 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
1508b8c0daaSLinus Torvalds 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
1518b8c0daaSLinus Torvalds 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
1528b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
1538b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
1548b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
1558b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
1568b8c0daaSLinus Torvalds 0xca, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */
1578b8c0daaSLinus Torvalds 0x00, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */
1588b8c0daaSLinus Torvalds 0xa1, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xa6, 0x00, /* 0xb0-0xb7 */
1598b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
1608b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
1618b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
1628b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
1638b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
1648b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
1658b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
1668b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, /* 0xf0-0xf7 */
1678b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
1688b8c0daaSLinus Torvalds };
1698b8c0daaSLinus Torvalds
1708b8c0daaSLinus Torvalds static const unsigned char page01[256] = {
1718b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
1728b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
1738b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
1748b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
1758b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
1768b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
1778b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
1788b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
1798b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
1808b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
1818b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
1828b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
1838b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
1848b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
1858b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
1868b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
1878b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
1888b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
1898b8c0daaSLinus Torvalds 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
1908b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
1918b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
1928b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
1938b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
1948b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
1958b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
1968b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
1978b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
1988b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
1998b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2008b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
2018b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
2028b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2038b8c0daaSLinus Torvalds };
2048b8c0daaSLinus Torvalds
2058b8c0daaSLinus Torvalds static const unsigned char page04[256] = {
2068b8c0daaSLinus Torvalds 0x00, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, /* 0x00-0x07 */
2078b8c0daaSLinus Torvalds 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x00, 0xd8, 0xda, /* 0x08-0x0f */
2088b8c0daaSLinus Torvalds 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
2098b8c0daaSLinus Torvalds 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
2108b8c0daaSLinus Torvalds 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
2118b8c0daaSLinus Torvalds 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
2128b8c0daaSLinus Torvalds 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */
2138b8c0daaSLinus Torvalds 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */
2148b8c0daaSLinus Torvalds 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */
2158b8c0daaSLinus Torvalds 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0x48-0x4f */
2168b8c0daaSLinus Torvalds 0x00, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, /* 0x50-0x57 */
2178b8c0daaSLinus Torvalds 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x00, 0xd9, 0xdb, /* 0x58-0x5f */
2188b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
2198b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
2208b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
2218b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
2228b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
2238b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
2248b8c0daaSLinus Torvalds 0xa2, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
2258b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2268b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
2278b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2288b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2298b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
2308b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
2318b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
2328b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
2338b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
2348b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2358b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
2368b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
2378b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2388b8c0daaSLinus Torvalds };
2398b8c0daaSLinus Torvalds
2408b8c0daaSLinus Torvalds static const unsigned char page20[256] = {
2418b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
2428b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
2438b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */
2448b8c0daaSLinus Torvalds 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0xd7, 0x00, /* 0x18-0x1f */
2458b8c0daaSLinus Torvalds 0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */
2468b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
2478b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
2488b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
2498b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
2508b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
2518b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
2528b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
2538b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
2548b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
2558b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
2568b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
2578b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
2588b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
2598b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
2608b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2618b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
2628b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2638b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2648b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
2658b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
2668b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
2678b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
2688b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
2698b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2708b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
2718b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
2728b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2738b8c0daaSLinus Torvalds };
2748b8c0daaSLinus Torvalds
2758b8c0daaSLinus Torvalds static const unsigned char page21[256] = {
2768b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
2778b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
2788b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x00, /* 0x10-0x17 */
2798b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
2808b8c0daaSLinus Torvalds 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
2818b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
2828b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
2838b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
2848b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
2858b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
2868b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
2878b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
2888b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
2898b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
2908b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
2918b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
2928b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
2938b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
2948b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
2958b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2968b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
2978b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2988b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2998b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
3008b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
3018b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
3028b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
3038b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
3048b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
3058b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
3068b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
3078b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
3088b8c0daaSLinus Torvalds };
3098b8c0daaSLinus Torvalds
3108b8c0daaSLinus Torvalds static const unsigned char page22[256] = {
3118b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */
3128b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
3138b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
3148b8c0daaSLinus Torvalds 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */
3158b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
3168b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
3178b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
3188b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
3198b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
3208b8c0daaSLinus Torvalds 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
3218b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
3228b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
3238b8c0daaSLinus Torvalds 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */
3248b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
3258b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
3268b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
3278b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
3288b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
3298b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
3308b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
3318b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
3328b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
3338b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
3348b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
3358b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
3368b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
3378b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
3388b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
3398b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
3408b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
3418b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
3428b8c0daaSLinus Torvalds 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
3438b8c0daaSLinus Torvalds };
3448b8c0daaSLinus Torvalds
3458b8c0daaSLinus Torvalds static const unsigned char *const page_uni2charset[256] = {
3468b8c0daaSLinus Torvalds page00, page01, NULL, NULL, page04, NULL, NULL, NULL,
3478b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3488b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3498b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3508b8c0daaSLinus Torvalds page20, page21, page22, NULL, NULL, NULL, NULL, NULL,
3518b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3528b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3538b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3548b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3558b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3568b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3578b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3588b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3598b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3608b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3618b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3628b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3638b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3648b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3658b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3668b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3678b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3688b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3698b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3708b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3718b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3728b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3738b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3748b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3758b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3768b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3778b8c0daaSLinus Torvalds NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3788b8c0daaSLinus Torvalds };
3798b8c0daaSLinus Torvalds
3808b8c0daaSLinus Torvalds static const unsigned char charset2lower[256] = {
3818b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x00-0x07 */
3828b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08-0x0f */
3838b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x10-0x17 */
3848b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x18-0x1f */
3858b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x20-0x27 */
3868b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x28-0x2f */
3878b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x30-0x37 */
3888b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x38-0x3f */
3898b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x40-0x47 */
3908b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x48-0x4f */
3918b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50-0x57 */
3928b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x58-0x5f */
3938b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x60-0x67 */
3948b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x68-0x6f */
3958b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x70-0x77 */
3968b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x78-0x7f */
3978b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x80-0x87 */
3988b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x88-0x8f */
3998b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x90-0x97 */
4008b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x98-0x9f */
4018b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa0-0xa7 */
4028b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa8-0xaf */
4038b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb0-0xb7 */
4048b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb8-0xbf */
4058b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc0-0xc7 */
4068b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc8-0xcf */
4078b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd0-0xd7 */
4088b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd8-0xdf */
4098b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe0-0xe7 */
4108b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe8-0xef */
4118b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf0-0xf7 */
4128b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf8-0xff */
4138b8c0daaSLinus Torvalds };
4148b8c0daaSLinus Torvalds
4158b8c0daaSLinus Torvalds static const unsigned char charset2upper[256] = {
4168b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x00-0x07 */
4178b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08-0x0f */
4188b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x10-0x17 */
4198b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x18-0x1f */
4208b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x20-0x27 */
4218b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x28-0x2f */
4228b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x30-0x37 */
4238b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x38-0x3f */
4248b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x40-0x47 */
4258b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x48-0x4f */
4268b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50-0x57 */
4278b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x58-0x5f */
4288b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x60-0x67 */
4298b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x68-0x6f */
4308b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x70-0x77 */
4318b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x78-0x7f */
4328b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x80-0x87 */
4338b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x88-0x8f */
4348b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x90-0x97 */
4358b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x98-0x9f */
4368b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa0-0xa7 */
4378b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa8-0xaf */
4388b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb0-0xb7 */
4398b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb8-0xbf */
4408b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc0-0xc7 */
4418b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc8-0xcf */
4428b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd0-0xd7 */
4438b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd8-0xdf */
4448b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe0-0xe7 */
4458b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe8-0xef */
4468b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf0-0xf7 */
4478b8c0daaSLinus Torvalds 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf8-0xff */
4488b8c0daaSLinus Torvalds };
4498b8c0daaSLinus Torvalds
uni2char(wchar_t uni,unsigned char * out,int boundlen)4508b8c0daaSLinus Torvalds static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
4518b8c0daaSLinus Torvalds {
4528b8c0daaSLinus Torvalds const unsigned char *uni2charset;
4538b8c0daaSLinus Torvalds unsigned char cl = uni & 0x00ff;
4548b8c0daaSLinus Torvalds unsigned char ch = (uni & 0xff00) >> 8;
4558b8c0daaSLinus Torvalds
4568b8c0daaSLinus Torvalds if (boundlen <= 0)
4578b8c0daaSLinus Torvalds return -ENAMETOOLONG;
4588b8c0daaSLinus Torvalds
4598b8c0daaSLinus Torvalds uni2charset = page_uni2charset[ch];
4608b8c0daaSLinus Torvalds if (uni2charset && uni2charset[cl])
4618b8c0daaSLinus Torvalds out[0] = uni2charset[cl];
4628b8c0daaSLinus Torvalds else
4638b8c0daaSLinus Torvalds return -EINVAL;
4648b8c0daaSLinus Torvalds return 1;
4658b8c0daaSLinus Torvalds }
4668b8c0daaSLinus Torvalds
char2uni(const unsigned char * rawstring,int boundlen,wchar_t * uni)4678b8c0daaSLinus Torvalds static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
4688b8c0daaSLinus Torvalds {
4698b8c0daaSLinus Torvalds *uni = charset2uni[*rawstring];
4708b8c0daaSLinus Torvalds if (*uni == 0x0000)
4718b8c0daaSLinus Torvalds return -EINVAL;
4728b8c0daaSLinus Torvalds return 1;
4738b8c0daaSLinus Torvalds }
4748b8c0daaSLinus Torvalds
4758b8c0daaSLinus Torvalds static struct nls_table table = {
4768b8c0daaSLinus Torvalds .charset = "maccyrillic",
4778b8c0daaSLinus Torvalds .uni2char = uni2char,
4788b8c0daaSLinus Torvalds .char2uni = char2uni,
4798b8c0daaSLinus Torvalds .charset2lower = charset2lower,
4808b8c0daaSLinus Torvalds .charset2upper = charset2upper,
4818b8c0daaSLinus Torvalds };
4828b8c0daaSLinus Torvalds
init_nls_maccyrillic(void)4838b8c0daaSLinus Torvalds static int __init init_nls_maccyrillic(void)
4848b8c0daaSLinus Torvalds {
4858b8c0daaSLinus Torvalds return register_nls(&table);
4868b8c0daaSLinus Torvalds }
4878b8c0daaSLinus Torvalds
exit_nls_maccyrillic(void)4888b8c0daaSLinus Torvalds static void __exit exit_nls_maccyrillic(void)
4898b8c0daaSLinus Torvalds {
4908b8c0daaSLinus Torvalds unregister_nls(&table);
4918b8c0daaSLinus Torvalds }
4928b8c0daaSLinus Torvalds
4938b8c0daaSLinus Torvalds module_init(init_nls_maccyrillic)
4948b8c0daaSLinus Torvalds module_exit(exit_nls_maccyrillic)
4958b8c0daaSLinus Torvalds
496*d694e46aSJeff Johnson MODULE_DESCRIPTION("NLS Codepage maccyrillic");
4978b8c0daaSLinus Torvalds MODULE_LICENSE("Dual BSD/GPL");
498