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