Debian Codegraph @

src/varia.c

raw symbols SCIP
1 /* Conversion of files between different charsets and surfaces.
2 Copyright © 1999-2018 Free Software Foundation, Inc.
3 Contributed by François Pinard <[email protected]>, 1993.
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 as published by the Free Software Foundation; either version 3 of the
8 License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the Recode Library; see the file `COPYING.LIB'.
17 If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #include "config.h"
21 #include "common.h"
22 #include "decsteps.h"
23
24 /* This file contains various temporary tables. These would ideally all go
25 away once Keld will be given references, solid enough, to really integrate
26 these tables in RFC1345 (.bis, .ter :-). */
27
28 /* Czech tables. */
29
30 /* Lukas Petrlik <[email protected]>, 1996-04-02, and Martin Mares
31 <[email protected]>, 1999-01-05, both sent Kamenicky and Cork tables. The
32 Kamenicky table was made to conform to Wikipedia:
33 https://en.wikipedia.org/wiki/Kamenick%C3%BD_encoding */
34
35 /* These tables use standard latin alphabet with Czech accented letters.
36 They use a subset of ISO-8859-2, plus a few strange characters. */
37
38 /* KEYBCS2, Kamenicky. "Source: the Reality :-)", as says Lukas. According
39 to Martin, several sources list CP859 as being equivalent to the Kamenicky
40 Brothers code, but neither of them seems to be authoritative enough. */
41
42 static const unsigned short data_kamenicky[] =
43 {
44 128, 0x010C, DONE,
45 129, 0x00FC, DONE,
46 130, 0x00E9, DONE,
47 131, 0x010F, DONE,
48 132, 0x00E4, DONE,
49 133, 0x010E, DONE,
50 134, 0x0164, DONE,
51 135, 0x010D, DONE,
52 136, 0x011B, DONE,
53 137, 0x011A, DONE,
54 138, 0x0139, DONE,
55 139, 0x00CD, DONE,
56 140, 0x013E, DONE,
57 141, 0x013A, DONE,
58 142, 0x00C4, DONE,
59 143, 0x00C1, DONE,
60 144, 0x00C9, DONE,
61 145, 0x017E, DONE,
62 146, 0x017D, DONE,
63 147, 0x00F4, DONE,
64 148, 0x00F6, DONE,
65 149, 0x00D3, DONE,
66 150, 0x016F, DONE,
67 151, 0x00DA, DONE,
68 152, 0x00FD, DONE,
69 153, 0x00D6, DONE,
70 154, 0x00DC, DONE,
71 155, 0x0160, DONE,
72 156, 0x013D, DONE,
73 157, 0x00DD, DONE,
74 158, 0x0158, DONE,
75 159, 0x0165, DONE, /* latin small letter t with caron */
76 160, 0x00E1, DONE,
77 161, 0x00ED, DONE,
78 162, 0x00F3, DONE,
79 163, 0x00FA, DONE,
80 164, 0x0148, DONE,
81 165, 0x0147, DONE,
82 166, 0x016E, DONE,
83 167, 0x00D4, DONE,
84 168, 0x0161, DONE,
85 169, 0x0159, DONE,
86 170, 0x0155, DONE,
87 171, 0x0154, DONE,
88 172, 0x00BC, DONE,
89 173, 0x00A7, DONE,
90 174, 0x00AB, DONE,
91 175, 0x00BB, DONE,
92 176, 0x2591, DONE,
93 177, 0x2592, DONE,
94 178, 0x2593, DONE,
95 179, 0x2502, DONE,
96 180, 0x2524, DONE,
97 181, 0x2561, DONE,
98 182, 0x2562, DONE,
99 183, 0x2556, DONE,
100 184, 0x2555, DONE,
101 185, 0x2563, DONE,
102 186, 0x2551, DONE,
103 187, 0x2557, DONE,
104 188, 0x255D, DONE,
105 189, 0x255C, DONE,
106 190, 0x255B, DONE,
107 191, 0x2510, DONE,
108 192, 0x2514, DONE,
109 193, 0x2534, DONE,
110 194, 0x252C, DONE,
111 195, 0x251C, DONE,
112 196, 0x2500, DONE,
113 197, 0x253C, DONE,
114 198, 0x255E, DONE,
115 199, 0x255F, DONE,
116 200, 0x255A, DONE,
117 201, 0x2554, DONE,
118 202, 0x2569, DONE,
119 203, 0x2566, DONE,
120 204, 0x2560, DONE,
121 205, 0x2550, DONE,
122 206, 0x256C, DONE,
123 207, 0x2567, DONE,
124 208, 0x2568, DONE,
125 209, 0x2564, DONE,
126 210, 0x2565, DONE,
127 211, 0x2559, DONE,
128 212, 0x2558, DONE,
129 213, 0x2552, DONE,
130 214, 0x2553, DONE,
131 215, 0x256B, DONE,
132 216, 0x256A, DONE,
133 217, 0x2518, DONE,
134 218, 0x250C, DONE,
135 219, 0x2588, DONE,
136 220, 0x2584, DONE,
137 221, 0x258C, DONE,
138 222, 0x2590, DONE,
139 223, 0x2580, DONE,
140 224, 0x03B1, DONE,
141 225, 0x03B2, DONE,
142 226, 0x0393, DONE,
143 227, 0x03C0, DONE,
144 228, 0x03A3, DONE,
145 229, 0x03C3, DONE,
146 230, 0x03BC, DONE,
147 231, 0x03C4, DONE,
148 232, 0x03A6, DONE,
149 233, 0x0398, DONE,
150 234, 0x03A9, DONE,
151 235, 0x03B4, DONE,
152 236, 0x221E, DONE,
153 237, 0x03C6, DONE, /* greek small letter phi */
154 238, 0x03B5, DONE, /* element of */
155 239, 0x2229, DONE, /* intersection */
156 240, 0x224D, DONE, /* equivalent to */
157 241, 0x00B1, DONE,
158 242, 0x2265, DONE,
159 243, 0x2264, DONE,
160 244, 0x2320, DONE,
161 245, 0x2321, DONE,
162 246, 0x00F7, DONE,
163 247, 0x2248, DONE,
164 248, 0x00B0, DONE, /* degree sign */
165 249, 0x2219, DONE, /* bullet operator */
166 250, 0x00B7, DONE, /* middle dot */
167 251, 0x221A, DONE,
168 252, 0x207F, DONE,
169 253, 0x00B2, DONE,
170 254, 0x25A0, DONE,
171 255, 0x00A0, DONE,
172 DONE
173 };
174
175 /* CORK, T1. */
176
177 static const unsigned short data_cork[] =
178 {
179 /* I suspect Lukas used this mapping to convey T1 and CORK in a single
180 table, which may not be such a good thing. (He gave extra code, 0 to 31.) */
181 0, 0x0060, DONE,
182 1, 0x00B4, DONE,
183 2, 0x005E, DONE,
184 3, 0x007E, DONE,
185 4, 0x00A8, DONE,
186 5, 0x02DD, DONE,
187 6, 0x02DA, DONE,
188 7, 0x02C7, DONE,
189 8, 0x02D8, DONE,
190 9, 0x00AF, DONE,
191 10, 0x02D9, DONE,
192 11, 0x00B8, DONE,
193 12, 0x02DB, DONE,
194 13, 0x201A, DONE,
195 14, 0x2039, DONE,
196 15, 0x203A, DONE,
197 16, 0x201C, DONE,
198 17, 0x201D, DONE,
199 18, 0x201E, DONE,
200 19, 0x00AB, DONE,
201 20, 0x00BB, DONE,
202 21, 0x2013, DONE,
203 22, 0x2014, DONE,
204 23, DONE,
205 24, 0x2080, DONE,
206 25, 0x0131, DONE,
207 26, 0x0237, DONE,
208 27, 0xFB00, DONE,
209 28, 0xFB01, DONE,
210 29, 0xFB02, DONE,
211 30, 0xFB03, DONE,
212 31, 0xFB04, DONE,
213 127, 0x2010, DONE,
214 128, 0x0102, DONE,
215 129, 0x0104, DONE,
216 130, 0x0106, DONE,
217 131, 0x010C, DONE,
218 132, 0x010E, DONE,
219 133, 0x011A, DONE,
220 134, 0x0118, DONE,
221 135, 0x011E, DONE,
222 136, 0x0139, DONE,
223 137, 0x013D, DONE,
224 138, 0x0141, DONE,
225 139, 0x0143, DONE,
226 140, 0x0147, DONE,
227 141, 0x014A, DONE,
228 142, 0x0150, DONE,
229 143, 0x0154, DONE,
230 144, 0x0158, DONE,
231 145, 0x015A, DONE,
232 146, 0x0160, DONE,
233 147, 0x015E, DONE,
234 148, 0x0164, DONE,
235 149, 0x0162, DONE,
236 150, 0x0170, DONE,
237 151, 0x016E, DONE,
238 152, 0x0178, DONE,
239 153, 0x0179, DONE,
240 154, 0x017D, DONE,
241 155, 0x017B, DONE,
242 156, 0x0132, DONE,
243 157, 0x0130, DONE,
244 158, 0x00F0, DONE,
245 159, 0x00A7, DONE,
246 160, 0x0103, DONE,
247 161, 0x0105, DONE,
248 162, 0x0107, DONE,
249 163, 0x010D, DONE,
250 164, 0x010F, DONE,
251 165, 0x011B, DONE,
252 166, 0x0119, DONE,
253 167, 0x011F, DONE,
254 168, 0x013A, DONE,
255 169, 0x013E, DONE,
256 170, 0x0142, DONE,
257 171, 0x0144, DONE,
258 172, 0x0148, DONE,
259 173, 0x014B, DONE,
260 174, 0x0151, DONE,
261 175, 0x0155, DONE,
262 176, 0x0159, DONE,
263 177, 0x015B, DONE,
264 178, 0x0161, DONE,
265 179, 0x015F, DONE,
266 180, 0x0165, DONE,
267 181, 0x0163, DONE,
268 182, 0x0171, DONE,
269 183, 0x016F, DONE,
270 184, 0x00FF, DONE,
271 185, 0x017A, DONE,
272 186, 0x017E, DONE,
273 187, 0x017C, DONE,
274 188, 0x0133, DONE,
275 189, 0x00A1, DONE,
276 190, 0x00BF, DONE,
277 191, 0x00A3, DONE,
278 215, 0x0152, DONE,
279 223, 0x1E9E, DONE,
280 247, 0x0153, DONE,
281 255, 0x00DF, DONE,
282 DONE
283 };
284
285 /* KOI-8_CS2. Source: CSN 36 9103.
286 From Lukas Petrlik <[email protected]>, 1996-04-02.
287
288 &g1esc x2d49 &g2esc x2e49 &g3esc x2f49 */
289
290 static const unsigned short data_koi8cs2[] =
291 {
292 36, 0x00A4, DONE,
293 161, DONE,
294 162, 0x00B4, DONE,
295 163, DONE,
296 164, 0x007E, DONE,
297 165, DONE,
298 166, 0x02D8, DONE,
299 167, 0x02D9, DONE,
300 169, DONE,
301 170, 0x02DA, DONE,
302 171, 0x00B8, DONE,
303 172, DONE,
304 173, 0x02DD, DONE,
305 174, 0x02DB, DONE,
306 175, 0x02C7, DONE,
307 176, 0x00A9, DONE,
308 177, 0x2122, DONE,
309 178, 0x250C, DONE,
310 179, 0x2510, DONE,
311 180, 0x2514, DONE,
312 181, 0x2518, DONE,
313 182, 0x2500, DONE,
314 183, 0x2193, DONE,
315 184, 0x03A9, DONE,
316 185, 0x00A7, DONE,
317 186, 0x03B1, DONE,
318 187, 0x03B3, DONE,
319 188, 0x03B5, DONE,
320 189, 0x03BC, DONE,
321 190, 0x03C0, DONE,
322 191, 0x03C9, DONE,
323 192, 0x00E0, DONE,
324 193, 0x00E1, DONE,
325 194, 0x01CE, DONE,
326 195, 0x010D, DONE,
327 196, 0x010F, DONE,
328 197, 0x011B, DONE,
329 198, 0x0155, DONE,
330 199, DONE, /* ch digraph as a single character,
331 as used in the Czech alphabet, FIXME! */
332 200, 0x00FC, DONE,
333 201, 0x00ED, DONE,
334 202, 0x016F, DONE,
335 203, 0x013A, DONE,
336 204, 0x013E, DONE,
337 205, 0x00F6, DONE,
338 206, 0x0148, DONE,
339 207, 0x00F3, DONE,
340 208, 0x00F4, DONE,
341 209, 0x00E4, DONE,
342 210, 0x0159, DONE,
343 211, 0x0161, DONE,
344 212, 0x0165, DONE,
345 213, 0x00FA, DONE,
346 214, 0x00EB, DONE,
347 215, 0x00E9, DONE,
348 216, 0x0171, DONE,
349 217, 0x00FD, DONE,
350 218, 0x017E, DONE,
351 219, DONE,
352 220, DONE,
353 221, 0x0151, DONE,
354 222, 0x0117, DONE,
355 224, 0x00C0, DONE,
356 225, 0x00C1, DONE,
357 226, 0x01CD, DONE,
358 227, 0x010C, DONE,
359 228, 0x010E, DONE,
360 229, 0x011A, DONE,
361 230, 0x0154, DONE,
362 231, DONE, /* CH digraph as a single character,
363 as used in the Czech alphabet, FIXME! */
364 232, 0x00DC, DONE,
365 233, 0x00CD, DONE,
366 234, 0x016E, DONE,
367 235, 0x0139, DONE,
368 236, 0x013D, DONE,
369 237, 0x00D6, DONE,
370 238, 0x0147, DONE,
371 239, 0x00D3, DONE,
372 240, 0x00D4, DONE,
373 241, 0x00C4, DONE,
374 242, 0x0158, DONE,
375 243, 0x0160, DONE,
376 244, 0x0164, DONE,
377 245, 0x00DA, DONE,
378 246, 0x00CB, DONE,
379 247, 0x00C9, DONE,
380 248, 0x0170, DONE,
381 249, 0x00DD, DONE,
382 250, 0x017D, DONE,
383 251, DONE,
384 252, DONE,
385 253, 0x0150, DONE,
386 254, 0x0116, DONE,
387 255, DONE,
388 DONE
389 };
390
391 bool
392 module_varia (RECODE_OUTER outer)
393 {
394 return
395
396 /* Czech tables. */
397
398 recode_declare_explode_data (outer, data_kamenicky, "KEYBCS2", NULL)
399 && recode_declare_explode_data (outer, data_cork, "CORK", NULL)
400 && recode_declare_explode_data (outer, data_koi8cs2, "KOI-8_CS2", NULL)
401
402 && recode_declare_alias (outer, "Kamenicky", "KEYBCS2")
403 && recode_declare_alias (outer, "T1", "CORK")
404
405 /* Russian aliases. */
406
407 && recode_declare_alias (outer, "1489", "KOI8-R")
408 && recode_declare_alias (outer, "RFC1489", "KOI8-R")
409
410 && recode_declare_alias (outer, "878", "KOI8-R")
411 && recode_declare_alias (outer, "CP878", "KOI8-R")
412 && recode_declare_alias (outer, "IBM878", "KOI8-R")
413
414 ;
415 }
416
417 void
418 delmodule_varia (_GL_UNUSED RECODE_OUTER outer)
419 {
420 }