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 [0x20] = 0x0020,
34 [0x21] = 0x0021,
35 [0x22] = 0x0022,
36 [0x23] = 0x0023,
37 [0x24] = 0x0024,
38 [0x25] = 0x0025,
39 [0x26] = 0x0026,
40 [0x27] = 0x0027,
41 [0x28] = 0x0028,
42 [0x29] = 0x0029,
43 [0x2a] = 0x002A,
44 [0x2b] = 0x002B,
45 [0x2c] = 0x002C,
46 [0x2d] = 0x002D,
47 [0x2e] = 0x002E,
48 [0x2f] = 0x002F,
49 [0x30] = 0x0030,
50 [0x31] = 0x0031,
51 [0x32] = 0x0032,
52 [0x33] = 0x0033,
53 [0x34] = 0x0034,
54 [0x35] = 0x0035,
55 [0x36] = 0x0036,
56 [0x37] = 0x0037,
57 [0x38] = 0x0038,
58 [0x39] = 0x0039,
59 [0x3a] = 0x003A,
60 [0x3b] = 0x003B,
61 [0x3c] = 0x003C,
62 [0x3d] = 0x003D,
63 [0x3e] = 0x003E,
64 [0x3f] = 0x003F,
65 [0x40] = 0x0040,
66 [0x41] = 0x0041,
67 [0x42] = 0x0042,
68 [0x43] = 0x0043,
69 [0x44] = 0x0044,
70 [0x45] = 0x0045,
71 [0x46] = 0x0046,
72 [0x47] = 0x0047,
73 [0x48] = 0x0048,
74 [0x49] = 0x0049,
75 [0x4a] = 0x004A,
76 [0x4b] = 0x004B,
77 [0x4c] = 0x004C,
78 [0x4d] = 0x004D,
79 [0x4e] = 0x004E,
80 [0x4f] = 0x004F,
81 [0x50] = 0x0050,
82 [0x51] = 0x0051,
83 [0x52] = 0x0052,
84 [0x53] = 0x0053,
85 [0x54] = 0x0054,
86 [0x55] = 0x0055,
87 [0x56] = 0x0056,
88 [0x57] = 0x0057,
89 [0x58] = 0x0058,
90 [0x59] = 0x0059,
91 [0x5a] = 0x005A,
92 [0x5b] = 0x005B,
93 [0x5c] = 0x005C,
94 [0x5d] = 0x005D,
95 [0x5e] = 0x005E,
96 [0x5f] = 0x005F,
97 [0x60] = 0x0060,
98 [0x61] = 0x0061,
99 [0x62] = 0x0062,
100 [0x63] = 0x0063,
101 [0x64] = 0x0064,
102 [0x65] = 0x0065,
103 [0x66] = 0x0066,
104 [0x67] = 0x0067,
105 [0x68] = 0x0068,
106 [0x69] = 0x0069,
107 [0x6a] = 0x006A,
108 [0x6b] = 0x006B,
109 [0x6c] = 0x006C,
110 [0x6d] = 0x006D,
111 [0x6e] = 0x006E,
112 [0x6f] = 0x006F,
113 [0x70] = 0x0070,
114 [0x71] = 0x0071,
115 [0x72] = 0x0072,
116 [0x73] = 0x0073,
117 [0x74] = 0x0074,
118 [0x75] = 0x0075,
119 [0x76] = 0x0076,
120 [0x77] = 0x0077,
121 [0x78] = 0x0078,
122 [0x79] = 0x0079,
123 [0x7a] = 0x007A,
124 [0x7b] = 0x007B,
125 [0x7c] = 0x007C,
126 [0x7d] = 0x007D,
127 [0x7e] = 0x007E,
128 [0x7f] = 0x007F,
129 [0x80] = 0x0080,
130 [0x81] = 0x0081,
131 [0x82] = 0x0082,
132 [0x83] = 0x0083,
133 [0x84] = 0x0084,
134 [0x85] = 0x0085,
135 [0x86] = 0x0086,
136 [0x87] = 0x0087,
137 [0x88] = 0x0088,
138 [0x89] = 0x0089,
139 [0x8a] = 0x008A,
140 [0x8b] = 0x008B,
141 [0x8c] = 0x008C,
142 [0x8d] = 0x008D,
143 [0x8e] = 0x008E,
144 [0x8f] = 0x008F,
145 [0x90] = 0x0090,
146 [0x91] = 0x0091,
147 [0x92] = 0x0092,
148 [0x93] = 0x0093,
149 [0x94] = 0x0094,
150 [0x95] = 0x0095,
151 [0x96] = 0x0096,
152 [0x97] = 0x0097,
153 [0x98] = 0x0098,
154 [0x99] = 0x0099,
155 [0x9a] = 0x009A,
156 [0x9b] = 0x009B,
157 [0x9c] = 0x009C,
158 [0x9d] = 0x009D,
159 [0x9e] = 0x009E,
160 [0x9f] = 0x009F,
161 [0xa0] = 0x00A0,
162 [0xa1] = 0x0126,
163 [0xa2] = 0x02D8,
164 [0xa3] = 0x00A3,
165 [0xa4] = 0x00A4,
166 [0xa6] = 0x0124,
167 [0xa7] = 0x00A7,
168 [0xa8] = 0x00A8,
169 [0xa9] = 0x0130,
170 [0xaa] = 0x015E,
171 [0xab] = 0x011E,
172 [0xac] = 0x0134,
173 [0xad] = 0x00AD,
174 [0xaf] = 0x017B,
175 [0xb0] = 0x00B0,
176 [0xb1] = 0x0127,
177 [0xb2] = 0x00B2,
178 [0xb3] = 0x00B3,
179 [0xb4] = 0x00B4,
180 [0xb5] = 0x00B5,
181 [0xb6] = 0x0125,
182 [0xb7] = 0x00B7,
183 [0xb8] = 0x00B8,
184 [0xb9] = 0x0131,
185 [0xba] = 0x015F,
186 [0xbb] = 0x011F,
187 [0xbc] = 0x0135,
188 [0xbd] = 0x00BD,
189 [0xbf] = 0x017C,
190 [0xc0] = 0x00C0,
191 [0xc1] = 0x00C1,
192 [0xc2] = 0x00C2,
193 [0xc4] = 0x00C4,
194 [0xc5] = 0x010A,
195 [0xc6] = 0x0108,
196 [0xc7] = 0x00C7,
197 [0xc8] = 0x00C8,
198 [0xc9] = 0x00C9,
199 [0xca] = 0x00CA,
200 [0xcb] = 0x00CB,
201 [0xcc] = 0x00CC,
202 [0xcd] = 0x00CD,
203 [0xce] = 0x00CE,
204 [0xcf] = 0x00CF,
205 [0xd1] = 0x00D1,
206 [0xd2] = 0x00D2,
207 [0xd3] = 0x00D3,
208 [0xd4] = 0x00D4,
209 [0xd5] = 0x0120,
210 [0xd6] = 0x00D6,
211 [0xd7] = 0x00D7,
212 [0xd8] = 0x011C,
213 [0xd9] = 0x00D9,
214 [0xda] = 0x00DA,
215 [0xdb] = 0x00DB,
216 [0xdc] = 0x00DC,
217 [0xdd] = 0x016C,
218 [0xde] = 0x015C,
219 [0xdf] = 0x00DF,
220 [0xe0] = 0x00E0,
221 [0xe1] = 0x00E1,
222 [0xe2] = 0x00E2,
223 [0xe4] = 0x00E4,
224 [0xe5] = 0x010B,
225 [0xe6] = 0x0109,
226 [0xe7] = 0x00E7,
227 [0xe8] = 0x00E8,
228 [0xe9] = 0x00E9,
229 [0xea] = 0x00EA,
230 [0xeb] = 0x00EB,
231 [0xec] = 0x00EC,
232 [0xed] = 0x00ED,
233 [0xee] = 0x00EE,
234 [0xef] = 0x00EF,
235 [0xf1] = 0x00F1,
236 [0xf2] = 0x00F2,
237 [0xf3] = 0x00F3,
238 [0xf4] = 0x00F4,
239 [0xf5] = 0x0121,
240 [0xf6] = 0x00F6,
241 [0xf7] = 0x00F7,
242 [0xf8] = 0x011D,
243 [0xf9] = 0x00F9,
244 [0xfa] = 0x00FA,
245 [0xfb] = 0x00FB,
246 [0xfc] = 0x00FC,
247 [0xfd] = 0x016D,
248 [0xfe] = 0x015D,
249 [0xff] = 0x02D9,
250};
251static const char from_ucs4[] = {
252 [0x0001] = 0x01,
253 [0x0002] = 0x02,
254 [0x0003] = 0x03,
255 [0x0004] = 0x04,
256 [0x0005] = 0x05,
257 [0x0006] = 0x06,
258 [0x0007] = 0x07,
259 [0x0008] = 0x08,
260 [0x0009] = 0x09,
261 [0x000A] = 0x0a,
262 [0x000B] = 0x0b,
263 [0x000C] = 0x0c,
264 [0x000D] = 0x0d,
265 [0x000E] = 0x0e,
266 [0x000F] = 0x0f,
267 [0x0010] = 0x10,
268 [0x0011] = 0x11,
269 [0x0012] = 0x12,
270 [0x0013] = 0x13,
271 [0x0014] = 0x14,
272 [0x0015] = 0x15,
273 [0x0016] = 0x16,
274 [0x0017] = 0x17,
275 [0x0018] = 0x18,
276 [0x0019] = 0x19,
277 [0x001A] = 0x1a,
278 [0x001B] = 0x1b,
279 [0x001C] = 0x1c,
280 [0x001D] = 0x1d,
281 [0x001E] = 0x1e,
282 [0x001F] = 0x1f,
283 [0x0020] = 0x20,
284 [0x0021] = 0x21,
285 [0x0022] = 0x22,
286 [0x0023] = 0x23,
287 [0x0024] = 0x24,
288 [0x0025] = 0x25,
289 [0x0026] = 0x26,
290 [0x0027] = 0x27,
291 [0x0028] = 0x28,
292 [0x0029] = 0x29,
293 [0x002A] = 0x2a,
294 [0x002B] = 0x2b,
295 [0x002C] = 0x2c,
296 [0x002D] = 0x2d,
297 [0x002E] = 0x2e,
298 [0x002F] = 0x2f,
299 [0x0030] = 0x30,
300 [0x0031] = 0x31,
301 [0x0032] = 0x32,
302 [0x0033] = 0x33,
303 [0x0034] = 0x34,
304 [0x0035] = 0x35,
305 [0x0036] = 0x36,
306 [0x0037] = 0x37,
307 [0x0038] = 0x38,
308 [0x0039] = 0x39,
309 [0x003A] = 0x3a,
310 [0x003B] = 0x3b,
311 [0x003C] = 0x3c,
312 [0x003D] = 0x3d,
313 [0x003E] = 0x3e,
314 [0x003F] = 0x3f,
315 [0x0040] = 0x40,
316 [0x0041] = 0x41,
317 [0x0042] = 0x42,
318 [0x0043] = 0x43,
319 [0x0044] = 0x44,
320 [0x0045] = 0x45,
321 [0x0046] = 0x46,
322 [0x0047] = 0x47,
323 [0x0048] = 0x48,
324 [0x0049] = 0x49,
325 [0x004A] = 0x4a,
326 [0x004B] = 0x4b,
327 [0x004C] = 0x4c,
328 [0x004D] = 0x4d,
329 [0x004E] = 0x4e,
330 [0x004F] = 0x4f,
331 [0x0050] = 0x50,
332 [0x0051] = 0x51,
333 [0x0052] = 0x52,
334 [0x0053] = 0x53,
335 [0x0054] = 0x54,
336 [0x0055] = 0x55,
337 [0x0056] = 0x56,
338 [0x0057] = 0x57,
339 [0x0058] = 0x58,
340 [0x0059] = 0x59,
341 [0x005A] = 0x5a,
342 [0x005B] = 0x5b,
343 [0x005C] = 0x5c,
344 [0x005D] = 0x5d,
345 [0x005E] = 0x5e,
346 [0x005F] = 0x5f,
347 [0x0060] = 0x60,
348 [0x0061] = 0x61,
349 [0x0062] = 0x62,
350 [0x0063] = 0x63,
351 [0x0064] = 0x64,
352 [0x0065] = 0x65,
353 [0x0066] = 0x66,
354 [0x0067] = 0x67,
355 [0x0068] = 0x68,
356 [0x0069] = 0x69,
357 [0x006A] = 0x6a,
358 [0x006B] = 0x6b,
359 [0x006C] = 0x6c,
360 [0x006D] = 0x6d,
361 [0x006E] = 0x6e,
362 [0x006F] = 0x6f,
363 [0x0070] = 0x70,
364 [0x0071] = 0x71,
365 [0x0072] = 0x72,
366 [0x0073] = 0x73,
367 [0x0074] = 0x74,
368 [0x0075] = 0x75,
369 [0x0076] = 0x76,
370 [0x0077] = 0x77,
371 [0x0078] = 0x78,
372 [0x0079] = 0x79,
373 [0x007A] = 0x7a,
374 [0x007B] = 0x7b,
375 [0x007C] = 0x7c,
376 [0x007D] = 0x7d,
377 [0x007E] = 0x7e,
378 [0x007F] = 0x7f,
379 [0x0080] = 0x80,
380 [0x0081] = 0x81,
381 [0x0082] = 0x82,
382 [0x0083] = 0x83,
383 [0x0084] = 0x84,
384 [0x0085] = 0x85,
385 [0x0086] = 0x86,
386 [0x0087] = 0x87,
387 [0x0088] = 0x88,
388 [0x0089] = 0x89,
389 [0x008A] = 0x8a,
390 [0x008B] = 0x8b,
391 [0x008C] = 0x8c,
392 [0x008D] = 0x8d,
393 [0x008E] = 0x8e,
394 [0x008F] = 0x8f,
395 [0x0090] = 0x90,
396 [0x0091] = 0x91,
397 [0x0092] = 0x92,
398 [0x0093] = 0x93,
399 [0x0094] = 0x94,
400 [0x0095] = 0x95,
401 [0x0096] = 0x96,
402 [0x0097] = 0x97,
403 [0x0098] = 0x98,
404 [0x0099] = 0x99,
405 [0x009A] = 0x9a,
406 [0x009B] = 0x9b,
407 [0x009C] = 0x9c,
408 [0x009D] = 0x9d,
409 [0x009E] = 0x9e,
410 [0x009F] = 0x9f,
411 [0x00A0] = 0xa0,
412 [0x00A3] = 0xa3,
413 [0x00A4] = 0xa4,
414 [0x00A7] = 0xa7,
415 [0x00A8] = 0xa8,
416 [0x00AD] = 0xad,
417 [0x00B0] = 0xb0,
418 [0x00B2] = 0xb2,
419 [0x00B3] = 0xb3,
420 [0x00B4] = 0xb4,
421 [0x00B5] = 0xb5,
422 [0x00B7] = 0xb7,
423 [0x00B8] = 0xb8,
424 [0x00BD] = 0xbd,
425 [0x00C0] = 0xc0,
426 [0x00C1] = 0xc1,
427 [0x00C2] = 0xc2,
428 [0x00C4] = 0xc4,
429 [0x00C7] = 0xc7,
430 [0x00C8] = 0xc8,
431 [0x00C9] = 0xc9,
432 [0x00CA] = 0xca,
433 [0x00CB] = 0xcb,
434 [0x00CC] = 0xcc,
435 [0x00CD] = 0xcd,
436 [0x00CE] = 0xce,
437 [0x00CF] = 0xcf,
438 [0x00D1] = 0xd1,
439 [0x00D2] = 0xd2,
440 [0x00D3] = 0xd3,
441 [0x00D4] = 0xd4,
442 [0x00D6] = 0xd6,
443 [0x00D7] = 0xd7,
444 [0x00D9] = 0xd9,
445 [0x00DA] = 0xda,
446 [0x00DB] = 0xdb,
447 [0x00DC] = 0xdc,
448 [0x00DF] = 0xdf,
449 [0x00E0] = 0xe0,
450 [0x00E1] = 0xe1,
451 [0x00E2] = 0xe2,
452 [0x00E4] = 0xe4,
453 [0x00E7] = 0xe7,
454 [0x00E8] = 0xe8,
455 [0x00E9] = 0xe9,
456 [0x00EA] = 0xea,
457 [0x00EB] = 0xeb,
458 [0x00EC] = 0xec,
459 [0x00ED] = 0xed,
460 [0x00EE] = 0xee,
461 [0x00EF] = 0xef,
462 [0x00F1] = 0xf1,
463 [0x00F2] = 0xf2,
464 [0x00F3] = 0xf3,
465 [0x00F4] = 0xf4,
466 [0x00F6] = 0xf6,
467 [0x00F7] = 0xf7,
468 [0x00F9] = 0xf9,
469 [0x00FA] = 0xfa,
470 [0x00FB] = 0xfb,
471 [0x00FC] = 0xfc,
472 [0x0108] = 0xc6,
473 [0x0109] = 0xe6,
474 [0x010A] = 0xc5,
475 [0x010B] = 0xe5,
476 [0x011C] = 0xd8,
477 [0x011D] = 0xf8,
478 [0x011E] = 0xab,
479 [0x011F] = 0xbb,
480 [0x0120] = 0xd5,
481 [0x0121] = 0xf5,
482 [0x0124] = 0xa6,
483 [0x0125] = 0xb6,
484 [0x0126] = 0xa1,
485 [0x0127] = 0xb1,
486 [0x0130] = 0xa9,
487 [0x0131] = 0xb9,
488 [0x0134] = 0xac,
489 [0x0135] = 0xbc,
490 [0x015C] = 0xde,
491 [0x015D] = 0xfe,
492 [0x015E] = 0xaa,
493 [0x015F] = 0xba,
494 [0x016C] = 0xdd,
495 [0x016D] = 0xfd,
496 [0x017B] = 0xaf,
497 [0x017C] = 0xbf,
498 [0x02D8] = 0xa2,
499 [0x02D9] = 0xff,
500};
501