xref: /openbmc/linux/fs/nls/mac-cyrillic.c (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
1*8b8c0daaSLinus Torvalds /*
2*8b8c0daaSLinus Torvalds  * linux/fs/nls/mac-cyrillic.c
3*8b8c0daaSLinus Torvalds  *
4*8b8c0daaSLinus Torvalds  * Charset maccyrillic translation tables.
5*8b8c0daaSLinus Torvalds  * Generated automatically from the Unicode and charset
6*8b8c0daaSLinus Torvalds  * tables from the Unicode Organization (www.unicode.org).
7*8b8c0daaSLinus Torvalds  * The Unicode to charset table has only exact mappings.
8*8b8c0daaSLinus Torvalds  */
9*8b8c0daaSLinus Torvalds 
10*8b8c0daaSLinus Torvalds /*
11*8b8c0daaSLinus Torvalds  * COPYRIGHT AND PERMISSION NOTICE
12*8b8c0daaSLinus Torvalds  *
13*8b8c0daaSLinus Torvalds  * Copyright 1991-2012 Unicode, Inc.  All rights reserved.  Distributed under
14*8b8c0daaSLinus Torvalds  * the Terms of Use in http://www.unicode.org/copyright.html.
15*8b8c0daaSLinus Torvalds  *
16*8b8c0daaSLinus Torvalds  * Permission is hereby granted, free of charge, to any person obtaining a
17*8b8c0daaSLinus Torvalds  * copy of the Unicode data files and any associated documentation (the "Data
18*8b8c0daaSLinus Torvalds  * Files") or Unicode software and any associated documentation (the
19*8b8c0daaSLinus Torvalds  * "Software") to deal in the Data Files or Software without restriction,
20*8b8c0daaSLinus Torvalds  * including without limitation the rights to use, copy, modify, merge,
21*8b8c0daaSLinus Torvalds  * publish, distribute, and/or sell copies of the Data Files or Software, and
22*8b8c0daaSLinus Torvalds  * to permit persons to whom the Data Files or Software are furnished to do
23*8b8c0daaSLinus Torvalds  * so, provided that (a) the above copyright notice(s) and this permission
24*8b8c0daaSLinus Torvalds  * notice appear with all copies of the Data Files or Software, (b) both the
25*8b8c0daaSLinus Torvalds  * above copyright notice(s) and this permission notice appear in associated
26*8b8c0daaSLinus Torvalds  * documentation, and (c) there is clear notice in each modified Data File or
27*8b8c0daaSLinus Torvalds  * in the Software as well as in the documentation associated with the Data
28*8b8c0daaSLinus Torvalds  * File(s) or Software that the data or software has been modified.
29*8b8c0daaSLinus Torvalds  *
30*8b8c0daaSLinus Torvalds  * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
31*8b8c0daaSLinus Torvalds  * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32*8b8c0daaSLinus Torvalds  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
33*8b8c0daaSLinus Torvalds  * THIRD PARTY RIGHTS.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
34*8b8c0daaSLinus Torvalds  * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
35*8b8c0daaSLinus Torvalds  * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
36*8b8c0daaSLinus Torvalds  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
37*8b8c0daaSLinus Torvalds  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
38*8b8c0daaSLinus Torvalds  * PERFORMANCE OF THE DATA FILES OR SOFTWARE.
39*8b8c0daaSLinus Torvalds  *
40*8b8c0daaSLinus Torvalds  * Except as contained in this notice, the name of a copyright holder shall
41*8b8c0daaSLinus Torvalds  * not be used in advertising or otherwise to promote the sale, use or other
42*8b8c0daaSLinus Torvalds  * dealings in these Data Files or Software without prior written
43*8b8c0daaSLinus Torvalds  * authorization of the copyright holder.
44*8b8c0daaSLinus Torvalds  */
45*8b8c0daaSLinus Torvalds 
46*8b8c0daaSLinus Torvalds #include <linux/module.h>
47*8b8c0daaSLinus Torvalds #include <linux/kernel.h>
48*8b8c0daaSLinus Torvalds #include <linux/string.h>
49*8b8c0daaSLinus Torvalds #include <linux/nls.h>
50*8b8c0daaSLinus Torvalds #include <linux/errno.h>
51*8b8c0daaSLinus Torvalds 
52*8b8c0daaSLinus Torvalds static const wchar_t charset2uni[256] = {
53*8b8c0daaSLinus Torvalds 	/* 0x00 */
54*8b8c0daaSLinus Torvalds 	0x0000, 0x0001, 0x0002, 0x0003,
55*8b8c0daaSLinus Torvalds 	0x0004, 0x0005, 0x0006, 0x0007,
56*8b8c0daaSLinus Torvalds 	0x0008, 0x0009, 0x000a, 0x000b,
57*8b8c0daaSLinus Torvalds 	0x000c, 0x000d, 0x000e, 0x000f,
58*8b8c0daaSLinus Torvalds 	/* 0x10 */
59*8b8c0daaSLinus Torvalds 	0x0010, 0x0011, 0x0012, 0x0013,
60*8b8c0daaSLinus Torvalds 	0x0014, 0x0015, 0x0016, 0x0017,
61*8b8c0daaSLinus Torvalds 	0x0018, 0x0019, 0x001a, 0x001b,
62*8b8c0daaSLinus Torvalds 	0x001c, 0x001d, 0x001e, 0x001f,
63*8b8c0daaSLinus Torvalds 	/* 0x20 */
64*8b8c0daaSLinus Torvalds 	0x0020, 0x0021, 0x0022, 0x0023,
65*8b8c0daaSLinus Torvalds 	0x0024, 0x0025, 0x0026, 0x0027,
66*8b8c0daaSLinus Torvalds 	0x0028, 0x0029, 0x002a, 0x002b,
67*8b8c0daaSLinus Torvalds 	0x002c, 0x002d, 0x002e, 0x002f,
68*8b8c0daaSLinus Torvalds 	/* 0x30 */
69*8b8c0daaSLinus Torvalds 	0x0030, 0x0031, 0x0032, 0x0033,
70*8b8c0daaSLinus Torvalds 	0x0034, 0x0035, 0x0036, 0x0037,
71*8b8c0daaSLinus Torvalds 	0x0038, 0x0039, 0x003a, 0x003b,
72*8b8c0daaSLinus Torvalds 	0x003c, 0x003d, 0x003e, 0x003f,
73*8b8c0daaSLinus Torvalds 	/* 0x40 */
74*8b8c0daaSLinus Torvalds 	0x0040, 0x0041, 0x0042, 0x0043,
75*8b8c0daaSLinus Torvalds 	0x0044, 0x0045, 0x0046, 0x0047,
76*8b8c0daaSLinus Torvalds 	0x0048, 0x0049, 0x004a, 0x004b,
77*8b8c0daaSLinus Torvalds 	0x004c, 0x004d, 0x004e, 0x004f,
78*8b8c0daaSLinus Torvalds 	/* 0x50 */
79*8b8c0daaSLinus Torvalds 	0x0050, 0x0051, 0x0052, 0x0053,
80*8b8c0daaSLinus Torvalds 	0x0054, 0x0055, 0x0056, 0x0057,
81*8b8c0daaSLinus Torvalds 	0x0058, 0x0059, 0x005a, 0x005b,
82*8b8c0daaSLinus Torvalds 	0x005c, 0x005d, 0x005e, 0x005f,
83*8b8c0daaSLinus Torvalds 	/* 0x60 */
84*8b8c0daaSLinus Torvalds 	0x0060, 0x0061, 0x0062, 0x0063,
85*8b8c0daaSLinus Torvalds 	0x0064, 0x0065, 0x0066, 0x0067,
86*8b8c0daaSLinus Torvalds 	0x0068, 0x0069, 0x006a, 0x006b,
87*8b8c0daaSLinus Torvalds 	0x006c, 0x006d, 0x006e, 0x006f,
88*8b8c0daaSLinus Torvalds 	/* 0x70 */
89*8b8c0daaSLinus Torvalds 	0x0070, 0x0071, 0x0072, 0x0073,
90*8b8c0daaSLinus Torvalds 	0x0074, 0x0075, 0x0076, 0x0077,
91*8b8c0daaSLinus Torvalds 	0x0078, 0x0079, 0x007a, 0x007b,
92*8b8c0daaSLinus Torvalds 	0x007c, 0x007d, 0x007e, 0x007f,
93*8b8c0daaSLinus Torvalds 	/* 0x80 */
94*8b8c0daaSLinus Torvalds 	0x0410, 0x0411, 0x0412, 0x0413,
95*8b8c0daaSLinus Torvalds 	0x0414, 0x0415, 0x0416, 0x0417,
96*8b8c0daaSLinus Torvalds 	0x0418, 0x0419, 0x041a, 0x041b,
97*8b8c0daaSLinus Torvalds 	0x041c, 0x041d, 0x041e, 0x041f,
98*8b8c0daaSLinus Torvalds 	/* 0x90 */
99*8b8c0daaSLinus Torvalds 	0x0420, 0x0421, 0x0422, 0x0423,
100*8b8c0daaSLinus Torvalds 	0x0424, 0x0425, 0x0426, 0x0427,
101*8b8c0daaSLinus Torvalds 	0x0428, 0x0429, 0x042a, 0x042b,
102*8b8c0daaSLinus Torvalds 	0x042c, 0x042d, 0x042e, 0x042f,
103*8b8c0daaSLinus Torvalds 	/* 0xa0 */
104*8b8c0daaSLinus Torvalds 	0x2020, 0x00b0, 0x0490, 0x00a3,
105*8b8c0daaSLinus Torvalds 	0x00a7, 0x2022, 0x00b6, 0x0406,
106*8b8c0daaSLinus Torvalds 	0x00ae, 0x00a9, 0x2122, 0x0402,
107*8b8c0daaSLinus Torvalds 	0x0452, 0x2260, 0x0403, 0x0453,
108*8b8c0daaSLinus Torvalds 	/* 0xb0 */
109*8b8c0daaSLinus Torvalds 	0x221e, 0x00b1, 0x2264, 0x2265,
110*8b8c0daaSLinus Torvalds 	0x0456, 0x00b5, 0x0491, 0x0408,
111*8b8c0daaSLinus Torvalds 	0x0404, 0x0454, 0x0407, 0x0457,
112*8b8c0daaSLinus Torvalds 	0x0409, 0x0459, 0x040a, 0x045a,
113*8b8c0daaSLinus Torvalds 	/* 0xc0 */
114*8b8c0daaSLinus Torvalds 	0x0458, 0x0405, 0x00ac, 0x221a,
115*8b8c0daaSLinus Torvalds 	0x0192, 0x2248, 0x2206, 0x00ab,
116*8b8c0daaSLinus Torvalds 	0x00bb, 0x2026, 0x00a0, 0x040b,
117*8b8c0daaSLinus Torvalds 	0x045b, 0x040c, 0x045c, 0x0455,
118*8b8c0daaSLinus Torvalds 	/* 0xd0 */
119*8b8c0daaSLinus Torvalds 	0x2013, 0x2014, 0x201c, 0x201d,
120*8b8c0daaSLinus Torvalds 	0x2018, 0x2019, 0x00f7, 0x201e,
121*8b8c0daaSLinus Torvalds 	0x040e, 0x045e, 0x040f, 0x045f,
122*8b8c0daaSLinus Torvalds 	0x2116, 0x0401, 0x0451, 0x044f,
123*8b8c0daaSLinus Torvalds 	/* 0xe0 */
124*8b8c0daaSLinus Torvalds 	0x0430, 0x0431, 0x0432, 0x0433,
125*8b8c0daaSLinus Torvalds 	0x0434, 0x0435, 0x0436, 0x0437,
126*8b8c0daaSLinus Torvalds 	0x0438, 0x0439, 0x043a, 0x043b,
127*8b8c0daaSLinus Torvalds 	0x043c, 0x043d, 0x043e, 0x043f,
128*8b8c0daaSLinus Torvalds 	/* 0xf0 */
129*8b8c0daaSLinus Torvalds 	0x0440, 0x0441, 0x0442, 0x0443,
130*8b8c0daaSLinus Torvalds 	0x0444, 0x0445, 0x0446, 0x0447,
131*8b8c0daaSLinus Torvalds 	0x0448, 0x0449, 0x044a, 0x044b,
132*8b8c0daaSLinus Torvalds 	0x044c, 0x044d, 0x044e, 0x20ac,
133*8b8c0daaSLinus Torvalds };
134*8b8c0daaSLinus Torvalds 
135*8b8c0daaSLinus Torvalds static const unsigned char page00[256] = {
136*8b8c0daaSLinus Torvalds 	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
137*8b8c0daaSLinus Torvalds 	0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
138*8b8c0daaSLinus Torvalds 	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
139*8b8c0daaSLinus Torvalds 	0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
140*8b8c0daaSLinus Torvalds 	0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
141*8b8c0daaSLinus Torvalds 	0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
142*8b8c0daaSLinus Torvalds 	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
143*8b8c0daaSLinus Torvalds 	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
144*8b8c0daaSLinus Torvalds 	0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
145*8b8c0daaSLinus Torvalds 	0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
146*8b8c0daaSLinus Torvalds 	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
147*8b8c0daaSLinus Torvalds 	0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
148*8b8c0daaSLinus Torvalds 	0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
149*8b8c0daaSLinus Torvalds 	0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
150*8b8c0daaSLinus Torvalds 	0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
151*8b8c0daaSLinus Torvalds 	0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
152*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
153*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
154*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
155*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
156*8b8c0daaSLinus Torvalds 	0xca, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */
157*8b8c0daaSLinus Torvalds 	0x00, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */
158*8b8c0daaSLinus Torvalds 	0xa1, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xa6, 0x00, /* 0xb0-0xb7 */
159*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
160*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
161*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
162*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
163*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
164*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
165*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
166*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, /* 0xf0-0xf7 */
167*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
168*8b8c0daaSLinus Torvalds };
169*8b8c0daaSLinus Torvalds 
170*8b8c0daaSLinus Torvalds static const unsigned char page01[256] = {
171*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
172*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
173*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
174*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
175*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
176*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
177*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
178*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
179*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
180*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
181*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
182*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
183*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
184*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
185*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
186*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
187*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
188*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
189*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
190*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
191*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
192*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
193*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
194*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
195*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
196*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
197*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
198*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
199*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
200*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
201*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
202*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
203*8b8c0daaSLinus Torvalds };
204*8b8c0daaSLinus Torvalds 
205*8b8c0daaSLinus Torvalds static const unsigned char page04[256] = {
206*8b8c0daaSLinus Torvalds 	0x00, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, /* 0x00-0x07 */
207*8b8c0daaSLinus Torvalds 	0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x00, 0xd8, 0xda, /* 0x08-0x0f */
208*8b8c0daaSLinus Torvalds 	0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
209*8b8c0daaSLinus Torvalds 	0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
210*8b8c0daaSLinus Torvalds 	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
211*8b8c0daaSLinus Torvalds 	0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
212*8b8c0daaSLinus Torvalds 	0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */
213*8b8c0daaSLinus Torvalds 	0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */
214*8b8c0daaSLinus Torvalds 	0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */
215*8b8c0daaSLinus Torvalds 	0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0x48-0x4f */
216*8b8c0daaSLinus Torvalds 	0x00, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, /* 0x50-0x57 */
217*8b8c0daaSLinus Torvalds 	0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x00, 0xd9, 0xdb, /* 0x58-0x5f */
218*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
219*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
220*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
221*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
222*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
223*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
224*8b8c0daaSLinus Torvalds 	0xa2, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
225*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
226*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
227*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
228*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
229*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
230*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
231*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
232*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
233*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
234*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
235*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
236*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
237*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
238*8b8c0daaSLinus Torvalds };
239*8b8c0daaSLinus Torvalds 
240*8b8c0daaSLinus Torvalds static const unsigned char page20[256] = {
241*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
242*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
243*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */
244*8b8c0daaSLinus Torvalds 	0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0xd7, 0x00, /* 0x18-0x1f */
245*8b8c0daaSLinus Torvalds 	0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */
246*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
247*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
248*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
249*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
250*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
251*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
252*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
253*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
254*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
255*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
256*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
257*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
258*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
259*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
260*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
261*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
262*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
263*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
264*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
265*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
266*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
267*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
268*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
269*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
270*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
271*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
272*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
273*8b8c0daaSLinus Torvalds };
274*8b8c0daaSLinus Torvalds 
275*8b8c0daaSLinus Torvalds static const unsigned char page21[256] = {
276*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
277*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
278*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x00, /* 0x10-0x17 */
279*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
280*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
281*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
282*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
283*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
284*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
285*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
286*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
287*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
288*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
289*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
290*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
291*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
292*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
293*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
294*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
295*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
296*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
297*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
298*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
299*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
300*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
301*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
302*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
303*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
304*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
305*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
306*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
307*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
308*8b8c0daaSLinus Torvalds };
309*8b8c0daaSLinus Torvalds 
310*8b8c0daaSLinus Torvalds static const unsigned char page22[256] = {
311*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */
312*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
313*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
314*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */
315*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
316*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
317*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
318*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
319*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
320*8b8c0daaSLinus Torvalds 	0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
321*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
322*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
323*8b8c0daaSLinus Torvalds 	0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */
324*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
325*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
326*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
327*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
328*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
329*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
330*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
331*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
332*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
333*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
334*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
335*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
336*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
337*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
338*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
339*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
340*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
341*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
342*8b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
343*8b8c0daaSLinus Torvalds };
344*8b8c0daaSLinus Torvalds 
345*8b8c0daaSLinus Torvalds static const unsigned char *const page_uni2charset[256] = {
346*8b8c0daaSLinus Torvalds 	page00, page01, NULL,   NULL,   page04, NULL,   NULL,   NULL,
347*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
348*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
349*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
350*8b8c0daaSLinus Torvalds 	page20, page21, page22, NULL,   NULL,   NULL,   NULL,   NULL,
351*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
352*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
353*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
354*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
355*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
356*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
357*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
358*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
359*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
360*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
361*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
362*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
363*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
364*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
365*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
366*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
367*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
368*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
369*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
370*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
371*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
372*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
373*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
374*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
375*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
376*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
377*8b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
378*8b8c0daaSLinus Torvalds };
379*8b8c0daaSLinus Torvalds 
380*8b8c0daaSLinus Torvalds static const unsigned char charset2lower[256] = {
381*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x00-0x07 */
382*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08-0x0f */
383*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x10-0x17 */
384*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x18-0x1f */
385*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x20-0x27 */
386*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x28-0x2f */
387*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x30-0x37 */
388*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x38-0x3f */
389*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x40-0x47 */
390*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x48-0x4f */
391*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50-0x57 */
392*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x58-0x5f */
393*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x60-0x67 */
394*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x68-0x6f */
395*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x70-0x77 */
396*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x78-0x7f */
397*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x80-0x87 */
398*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x88-0x8f */
399*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x90-0x97 */
400*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x98-0x9f */
401*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa0-0xa7 */
402*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa8-0xaf */
403*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb0-0xb7 */
404*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb8-0xbf */
405*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc0-0xc7 */
406*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc8-0xcf */
407*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd0-0xd7 */
408*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd8-0xdf */
409*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe0-0xe7 */
410*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe8-0xef */
411*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf0-0xf7 */
412*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf8-0xff */
413*8b8c0daaSLinus Torvalds };
414*8b8c0daaSLinus Torvalds 
415*8b8c0daaSLinus Torvalds static const unsigned char charset2upper[256] = {
416*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x00-0x07 */
417*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08-0x0f */
418*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x10-0x17 */
419*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x18-0x1f */
420*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x20-0x27 */
421*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x28-0x2f */
422*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x30-0x37 */
423*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x38-0x3f */
424*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x40-0x47 */
425*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x48-0x4f */
426*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50-0x57 */
427*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x58-0x5f */
428*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x60-0x67 */
429*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x68-0x6f */
430*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x70-0x77 */
431*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x78-0x7f */
432*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x80-0x87 */
433*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x88-0x8f */
434*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x90-0x97 */
435*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x98-0x9f */
436*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa0-0xa7 */
437*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa8-0xaf */
438*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb0-0xb7 */
439*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb8-0xbf */
440*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc0-0xc7 */
441*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc8-0xcf */
442*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd0-0xd7 */
443*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd8-0xdf */
444*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe0-0xe7 */
445*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe8-0xef */
446*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf0-0xf7 */
447*8b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf8-0xff */
448*8b8c0daaSLinus Torvalds };
449*8b8c0daaSLinus Torvalds 
uni2char(wchar_t uni,unsigned char * out,int boundlen)450*8b8c0daaSLinus Torvalds static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
451*8b8c0daaSLinus Torvalds {
452*8b8c0daaSLinus Torvalds 	const unsigned char *uni2charset;
453*8b8c0daaSLinus Torvalds 	unsigned char cl = uni & 0x00ff;
454*8b8c0daaSLinus Torvalds 	unsigned char ch = (uni & 0xff00) >> 8;
455*8b8c0daaSLinus Torvalds 
456*8b8c0daaSLinus Torvalds 	if (boundlen <= 0)
457*8b8c0daaSLinus Torvalds 		return -ENAMETOOLONG;
458*8b8c0daaSLinus Torvalds 
459*8b8c0daaSLinus Torvalds 	uni2charset = page_uni2charset[ch];
460*8b8c0daaSLinus Torvalds 	if (uni2charset && uni2charset[cl])
461*8b8c0daaSLinus Torvalds 		out[0] = uni2charset[cl];
462*8b8c0daaSLinus Torvalds 	else
463*8b8c0daaSLinus Torvalds 		return -EINVAL;
464*8b8c0daaSLinus Torvalds 	return 1;
465*8b8c0daaSLinus Torvalds }
466*8b8c0daaSLinus Torvalds 
char2uni(const unsigned char * rawstring,int boundlen,wchar_t * uni)467*8b8c0daaSLinus Torvalds static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
468*8b8c0daaSLinus Torvalds {
469*8b8c0daaSLinus Torvalds 	*uni = charset2uni[*rawstring];
470*8b8c0daaSLinus Torvalds 	if (*uni == 0x0000)
471*8b8c0daaSLinus Torvalds 		return -EINVAL;
472*8b8c0daaSLinus Torvalds 	return 1;
473*8b8c0daaSLinus Torvalds }
474*8b8c0daaSLinus Torvalds 
475*8b8c0daaSLinus Torvalds static struct nls_table table = {
476*8b8c0daaSLinus Torvalds 	.charset	= "maccyrillic",
477*8b8c0daaSLinus Torvalds 	.uni2char	= uni2char,
478*8b8c0daaSLinus Torvalds 	.char2uni	= char2uni,
479*8b8c0daaSLinus Torvalds 	.charset2lower	= charset2lower,
480*8b8c0daaSLinus Torvalds 	.charset2upper	= charset2upper,
481*8b8c0daaSLinus Torvalds };
482*8b8c0daaSLinus Torvalds 
init_nls_maccyrillic(void)483*8b8c0daaSLinus Torvalds static int __init init_nls_maccyrillic(void)
484*8b8c0daaSLinus Torvalds {
485*8b8c0daaSLinus Torvalds 	return register_nls(&table);
486*8b8c0daaSLinus Torvalds }
487*8b8c0daaSLinus Torvalds 
exit_nls_maccyrillic(void)488*8b8c0daaSLinus Torvalds static void __exit exit_nls_maccyrillic(void)
489*8b8c0daaSLinus Torvalds {
490*8b8c0daaSLinus Torvalds 	unregister_nls(&table);
491*8b8c0daaSLinus Torvalds }
492*8b8c0daaSLinus Torvalds 
493*8b8c0daaSLinus Torvalds module_init(init_nls_maccyrillic)
494*8b8c0daaSLinus Torvalds module_exit(exit_nls_maccyrillic)
495*8b8c0daaSLinus Torvalds 
496*8b8c0daaSLinus Torvalds MODULE_LICENSE("Dual BSD/GPL");
497