1static const uint32_t to_ucs4[256] = {
2 [0x01] = 0x0001,
3 [0x02] = 0x0002,
4 [0x03] = 0x0003,
5 [0x04] = 0x0004,
6 [0x05] = 0x0005,
7 [0x06] = 0x0006,
8 [0x07] = 0x0007,
9 [0x08] = 0x0008,
10 [0x09] = 0x0009,
11 [0x0a] = 0x000A,
12 [0x0b] = 0x000B,
13 [0x0c] = 0x000C,
14 [0x0d] = 0x000D,
15 [0x0e] = 0x000E,
16 [0x0f] = 0x000F,
17 [0x10] = 0x0010,
18 [0x11] = 0x0011,
19 [0x12] = 0x0012,
20 [0x13] = 0x0013,
21 [0x14] = 0x0014,
22 [0x15] = 0x0015,
23 [0x16] = 0x0016,
24 [0x17] = 0x0017,
25 [0x18] = 0x0018,
26 [0x19] = 0x0019,
27 [0x1a] = 0x001A,
28 [0x1b] = 0x001B,
29 [0x1c] = 0x001C,
30 [0x1d] = 0x001D,
31 [0x1e] = 0x001E,
32 [0x1f] = 0x001F,
33 [0x40] = 0x0020,
34 [0x45] = 0x00E1,
35 [0x4a] = 0x003C,
36 [0x4b] = 0x002E,
37 [0x4c] = 0x00C1,
38 [0x4d] = 0x0028,
39 [0x4e] = 0x002B,
40 [0x4f] = 0x0021,
41 [0x50] = 0x00D0,
42 [0x51] = 0x00E9,
43 [0x55] = 0x00ED,
44 [0x59] = 0x0024,
45 [0x5a] = 0x0025,
46 [0x5b] = 0x00C9,
47 [0x5c] = 0x002A,
48 [0x5d] = 0x0029,
49 [0x5e] = 0x003B,
50 [0x5f] = 0x0026,
51 [0x60] = 0x002D,
52 [0x61] = 0x002F,
53 [0x69] = 0x0023,
54 [0x6a] = 0x2018,
55 [0x6b] = 0x002C,
56 [0x6c] = 0x00DE,
57 [0x6d] = 0x005F,
58 [0x6e] = 0x003E,
59 [0x6f] = 0x003F,
60 [0x75] = 0x00CD,
61 [0x78] = 0x007C,
62 [0x79] = 0x00F0,
63 [0x7a] = 0x003A,
64 [0x7b] = 0x00C6,
65 [0x7c] = 0x00D6,
66 [0x7d] = 0x0027,
67 [0x7e] = 0x003D,
68 [0x7f] = 0x0022,
69 [0x81] = 0x0061,
70 [0x82] = 0x0062,
71 [0x83] = 0x0063,
72 [0x84] = 0x0064,
73 [0x85] = 0x0065,
74 [0x86] = 0x0066,
75 [0x87] = 0x0067,
76 [0x88] = 0x0068,
77 [0x89] = 0x0069,
78 [0x8d] = 0x00DD,
79 [0x91] = 0x006A,
80 [0x92] = 0x006B,
81 [0x93] = 0x006C,
82 [0x94] = 0x006D,
83 [0x95] = 0x006E,
84 [0x96] = 0x006F,
85 [0x97] = 0x0070,
86 [0x98] = 0x0071,
87 [0x99] = 0x0072,
88 [0xa0] = 0x00B0,
89 [0xa1] = 0x00F6,
90 [0xa2] = 0x0073,
91 [0xa3] = 0x0074,
92 [0xa4] = 0x0075,
93 [0xa5] = 0x0076,
94 [0xa6] = 0x0077,
95 [0xa7] = 0x0078,
96 [0xa8] = 0x0079,
97 [0xa9] = 0x007A,
98 [0xac] = 0x005B,
99 [0xad] = 0x00FD,
100 [0xbc] = 0x005D,
101 [0xbd] = 0x00A8,
102 [0xc0] = 0x00FE,
103 [0xc1] = 0x0041,
104 [0xc2] = 0x0042,
105 [0xc3] = 0x0043,
106 [0xc4] = 0x0044,
107 [0xc5] = 0x0045,
108 [0xc6] = 0x0046,
109 [0xc7] = 0x0047,
110 [0xc8] = 0x0048,
111 [0xc9] = 0x0049,
112 [0xce] = 0x00F3,
113 [0xd0] = 0x00E6,
114 [0xd1] = 0x004A,
115 [0xd2] = 0x004B,
116 [0xd3] = 0x004C,
117 [0xd4] = 0x004D,
118 [0xd5] = 0x004E,
119 [0xd6] = 0x004F,
120 [0xd7] = 0x0050,
121 [0xd8] = 0x0051,
122 [0xd9] = 0x0052,
123 [0xde] = 0x00FA,
124 [0xe0] = 0x00B4,
125 [0xe2] = 0x0053,
126 [0xe3] = 0x0054,
127 [0xe4] = 0x0055,
128 [0xe5] = 0x0056,
129 [0xe6] = 0x0057,
130 [0xe7] = 0x0058,
131 [0xe8] = 0x0059,
132 [0xe9] = 0x005A,
133 [0xee] = 0x00D3,
134 [0xf0] = 0x0030,
135 [0xf1] = 0x0031,
136 [0xf2] = 0x0032,
137 [0xf3] = 0x0033,
138 [0xf4] = 0x0034,
139 [0xf5] = 0x0035,
140 [0xf6] = 0x0036,
141 [0xf7] = 0x0037,
142 [0xf8] = 0x0038,
143 [0xf9] = 0x0039,
144 [0xfe] = 0x00DA,
145 [0xff] = 0x007F,
146};
147static const struct gap from_idx[] = {
148 { .start = 0x0000, .end = 0x007f, .idx = 0 },
149 { .start = 0x00a8, .end = 0x00a8, .idx = -40 },
150 { .start = 0x00b0, .end = 0x00b4, .idx = -47 },
151 { .start = 0x00c1, .end = 0x00fe, .idx = -59 },
152 { .start = 0x2018, .end = 0x2018, .idx = -8020 },
153 { .start = 0xffff, .end = 0xffff, .idx = 0 }
154};
155static const char from_ucs4[] = {
156
157 '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
158 '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
159 '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
160 '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
161 '\x40', '\x4f', '\x7f', '\x69', '\x59', '\x5a', '\x5f', '\x7d',
162 '\x4d', '\x5d', '\x5c', '\x4e', '\x6b', '\x60', '\x4b', '\x61',
163 '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7',
164 '\xf8', '\xf9', '\x7a', '\x5e', '\x4a', '\x7e', '\x6e', '\x6f',
165 '\x00', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
166 '\xc8', '\xc9', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6',
167 '\xd7', '\xd8', '\xd9', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6',
168 '\xe7', '\xe8', '\xe9', '\xac', '\x00', '\xbc', '\x00', '\x6d',
169 '\x00', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87',
170 '\x88', '\x89', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96',
171 '\x97', '\x98', '\x99', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6',
172 '\xa7', '\xa8', '\xa9', '\x00', '\x78', '\x00', '\x00', '\xff',
173 '\xbd', '\xa0', '\x00', '\x00', '\x00', '\xe0', '\x4c', '\x00',
174 '\x00', '\x00', '\x00', '\x7b', '\x00', '\x00', '\x5b', '\x00',
175 '\x00', '\x00', '\x75', '\x00', '\x00', '\x50', '\x00', '\x00',
176 '\xee', '\x00', '\x00', '\x7c', '\x00', '\x00', '\x00', '\xfe',
177 '\x00', '\x00', '\x8d', '\x6c', '\x00', '\x00', '\x45', '\x00',
178 '\x00', '\x00', '\x00', '\xd0', '\x00', '\x00', '\x51', '\x00',
179 '\x00', '\x00', '\x55', '\x00', '\x00', '\x79', '\x00', '\x00',
180 '\xce', '\x00', '\x00', '\xa1', '\x00', '\x00', '\x00', '\xde',
181 '\x00', '\x00', '\xad', '\xc0', '\x6a',
182};
183