2 * CP863.cs - French Canadian (DOS) code page.
4 * Copyright (c) 2002 Southern Storm Software, Pty Ltd
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
25 // Generated from "ibm-863.ucm".
35 public class CP863
: ByteEncoding
38 : base(863, ToChars
, "French Canadian (DOS)",
39 "IBM863", "IBM863", "IBM863",
40 false, false, false, false, 1252)
43 private static readonly char[] ToChars
= {
44 '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005',
45 '\u0006', '\u0007', '\u0008', '\u0009', '\u000A', '\u000B',
46 '\u000C', '\u000D', '\u000E', '\u000F', '\u0010', '\u0011',
47 '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
48 '\u0018', '\u0019', '\u001C', '\u001B', '\u007F', '\u001D',
49 '\u001E', '\u001F', '\u0020', '\u0021', '\u0022', '\u0023',
50 '\u0024', '\u0025', '\u0026', '\u0027', '\u0028', '\u0029',
51 '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
52 '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035',
53 '\u0036', '\u0037', '\u0038', '\u0039', '\u003A', '\u003B',
54 '\u003C', '\u003D', '\u003E', '\u003F', '\u0040', '\u0041',
55 '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
56 '\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D',
57 '\u004E', '\u004F', '\u0050', '\u0051', '\u0052', '\u0053',
58 '\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059',
59 '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
60 '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065',
61 '\u0066', '\u0067', '\u0068', '\u0069', '\u006A', '\u006B',
62 '\u006C', '\u006D', '\u006E', '\u006F', '\u0070', '\u0071',
63 '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
64 '\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D',
65 '\u007E', '\u001A', '\u00C7', '\u00FC', '\u00E9', '\u00E2',
66 '\u00C2', '\u00E0', '\u00B6', '\u00E7', '\u00EA', '\u00EB',
67 '\u00E8', '\u00EF', '\u00EE', '\u2017', '\u00C0', '\u00A7',
68 '\u00C9', '\u00C8', '\u00CA', '\u00F4', '\u00CB', '\u00CF',
69 '\u00FB', '\u00F9', '\u00A4', '\u00D4', '\u00DC', '\u00A2',
70 '\u00A3', '\u00D9', '\u00DB', '\u0192', '\u00A6', '\u00B4',
71 '\u00F3', '\u00FA', '\u00A8', '\u00B8', '\u00B3', '\u00AF',
72 '\u00CE', '\u2310', '\u00AC', '\u00BD', '\u00BC', '\u00BE',
73 '\u00AB', '\u00BB', '\u2591', '\u2592', '\u2593', '\u2502',
74 '\u2524', '\u2561', '\u2562', '\u2556', '\u2555', '\u2563',
75 '\u2551', '\u2557', '\u255D', '\u255C', '\u255B', '\u2510',
76 '\u2514', '\u2534', '\u252C', '\u251C', '\u2500', '\u253C',
77 '\u255E', '\u255F', '\u255A', '\u2554', '\u2569', '\u2566',
78 '\u2560', '\u2550', '\u256C', '\u2567', '\u2568', '\u2564',
79 '\u2565', '\u2559', '\u2558', '\u2552', '\u2553', '\u256B',
80 '\u256A', '\u2518', '\u250C', '\u2588', '\u2584', '\u258C',
81 '\u2590', '\u2580', '\u03B1', '\u00DF', '\u0393', '\u03C0',
82 '\u03A3', '\u03C3', '\u03BC', '\u03C4', '\u03A6', '\u0398',
83 '\u03A9', '\u03B4', '\u221E', '\u03C6', '\u03B5', '\u2229',
84 '\u2261', '\u00B1', '\u2265', '\u2264', '\u2320', '\u2321',
85 '\u00F7', '\u2248', '\u00B0', '\u2219', '\u00B7', '\u221A',
86 '\u207F', '\u00B2', '\u25A0', '\u00A0',
89 protected unsafe override void ToBytes(char* chars
, int charCount
,
90 byte* bytes
, int byteCount
)
96 EncoderFallbackBuffer buffer
= null;
100 ch
= (int)(chars
[charIndex
++]);
101 if(ch
>= 26) switch(ch
)
203 case 0x001A: ch
= 0x7F; break;
204 case 0x001C: ch
= 0x1A; break;
205 case 0x007F: ch
= 0x1C; break;
206 case 0x00A0: ch
= 0xFF; break;
207 case 0x00A2: ch
= 0x9B; break;
208 case 0x00A3: ch
= 0x9C; break;
209 case 0x00A4: ch
= 0x98; break;
210 case 0x00A6: ch
= 0xA0; break;
211 case 0x00A7: ch
= 0x8F; break;
212 case 0x00A8: ch
= 0xA4; break;
213 case 0x00AB: ch
= 0xAE; break;
214 case 0x00AC: ch
= 0xAA; break;
215 case 0x00AF: ch
= 0xA7; break;
216 case 0x00B0: ch
= 0xF8; break;
217 case 0x00B1: ch
= 0xF1; break;
218 case 0x00B2: ch
= 0xFD; break;
219 case 0x00B3: ch
= 0xA6; break;
220 case 0x00B4: ch
= 0xA1; break;
221 case 0x00B6: ch
= 0x86; break;
222 case 0x00B7: ch
= 0xFA; break;
223 case 0x00B8: ch
= 0xA5; break;
224 case 0x00BB: ch
= 0xAF; break;
225 case 0x00BC: ch
= 0xAC; break;
226 case 0x00BD: ch
= 0xAB; break;
227 case 0x00BE: ch
= 0xAD; break;
228 case 0x00C0: ch
= 0x8E; break;
229 case 0x00C2: ch
= 0x84; break;
230 case 0x00C7: ch
= 0x80; break;
231 case 0x00C8: ch
= 0x91; break;
232 case 0x00C9: ch
= 0x90; break;
233 case 0x00CA: ch
= 0x92; break;
234 case 0x00CB: ch
= 0x94; break;
235 case 0x00CE: ch
= 0xA8; break;
236 case 0x00CF: ch
= 0x95; break;
237 case 0x00D4: ch
= 0x99; break;
238 case 0x00D9: ch
= 0x9D; break;
239 case 0x00DB: ch
= 0x9E; break;
240 case 0x00DC: ch
= 0x9A; break;
241 case 0x00DF: ch
= 0xE1; break;
242 case 0x00E0: ch
= 0x85; break;
243 case 0x00E2: ch
= 0x83; break;
244 case 0x00E7: ch
= 0x87; break;
245 case 0x00E8: ch
= 0x8A; break;
246 case 0x00E9: ch
= 0x82; break;
247 case 0x00EA: ch
= 0x88; break;
248 case 0x00EB: ch
= 0x89; break;
249 case 0x00EE: ch
= 0x8C; break;
250 case 0x00EF: ch
= 0x8B; break;
251 case 0x00F3: ch
= 0xA2; break;
252 case 0x00F4: ch
= 0x93; break;
253 case 0x00F7: ch
= 0xF6; break;
254 case 0x00F9: ch
= 0x97; break;
255 case 0x00FA: ch
= 0xA3; break;
256 case 0x00FB: ch
= 0x96; break;
257 case 0x00FC: ch
= 0x81; break;
258 case 0x0192: ch
= 0x9F; break;
259 case 0x0393: ch
= 0xE2; break;
260 case 0x0398: ch
= 0xE9; break;
261 case 0x03A3: ch
= 0xE4; break;
262 case 0x03A6: ch
= 0xE8; break;
263 case 0x03A9: ch
= 0xEA; break;
264 case 0x03B1: ch
= 0xE0; break;
265 case 0x03B4: ch
= 0xEB; break;
266 case 0x03B5: ch
= 0xEE; break;
267 case 0x03BC: ch
= 0xE6; break;
268 case 0x03C0: ch
= 0xE3; break;
269 case 0x03C3: ch
= 0xE5; break;
270 case 0x03C4: ch
= 0xE7; break;
271 case 0x03C6: ch
= 0xED; break;
272 case 0x2017: ch
= 0x8D; break;
273 case 0x2022: ch
= 0x07; break;
274 case 0x203C: ch
= 0x13; break;
275 case 0x203E: ch
= 0xA7; break;
276 case 0x207F: ch
= 0xFC; break;
277 case 0x2190: ch
= 0x1B; break;
278 case 0x2191: ch
= 0x18; break;
279 case 0x2192: ch
= 0x1A; break;
280 case 0x2193: ch
= 0x19; break;
281 case 0x2194: ch
= 0x1D; break;
282 case 0x2195: ch
= 0x12; break;
283 case 0x21A8: ch
= 0x17; break;
284 case 0x2219: ch
= 0xF9; break;
285 case 0x221A: ch
= 0xFB; break;
286 case 0x221E: ch
= 0xEC; break;
287 case 0x221F: ch
= 0x1C; break;
288 case 0x2229: ch
= 0xEF; break;
289 case 0x2248: ch
= 0xF7; break;
290 case 0x2261: ch
= 0xF0; break;
291 case 0x2264: ch
= 0xF3; break;
292 case 0x2265: ch
= 0xF2; break;
293 case 0x2302: ch
= 0x7F; break;
294 case 0x2310: ch
= 0xA9; break;
295 case 0x2320: ch
= 0xF4; break;
296 case 0x2321: ch
= 0xF5; break;
297 case 0x2500: ch
= 0xC4; break;
298 case 0x2502: ch
= 0xB3; break;
299 case 0x250C: ch
= 0xDA; break;
300 case 0x2510: ch
= 0xBF; break;
301 case 0x2514: ch
= 0xC0; break;
302 case 0x2518: ch
= 0xD9; break;
303 case 0x251C: ch
= 0xC3; break;
304 case 0x2524: ch
= 0xB4; break;
305 case 0x252C: ch
= 0xC2; break;
306 case 0x2534: ch
= 0xC1; break;
307 case 0x253C: ch
= 0xC5; break;
308 case 0x2550: ch
= 0xCD; break;
309 case 0x2551: ch
= 0xBA; break;
310 case 0x2552: ch
= 0xD5; break;
311 case 0x2553: ch
= 0xD6; break;
312 case 0x2554: ch
= 0xC9; break;
313 case 0x2555: ch
= 0xB8; break;
314 case 0x2556: ch
= 0xB7; break;
315 case 0x2557: ch
= 0xBB; break;
316 case 0x2558: ch
= 0xD4; break;
317 case 0x2559: ch
= 0xD3; break;
318 case 0x255A: ch
= 0xC8; break;
319 case 0x255B: ch
= 0xBE; break;
320 case 0x255C: ch
= 0xBD; break;
321 case 0x255D: ch
= 0xBC; break;
322 case 0x255E: ch
= 0xC6; break;
323 case 0x255F: ch
= 0xC7; break;
324 case 0x2560: ch
= 0xCC; break;
325 case 0x2561: ch
= 0xB5; break;
326 case 0x2562: ch
= 0xB6; break;
327 case 0x2563: ch
= 0xB9; break;
328 case 0x2564: ch
= 0xD1; break;
329 case 0x2565: ch
= 0xD2; break;
330 case 0x2566: ch
= 0xCB; break;
331 case 0x2567: ch
= 0xCF; break;
332 case 0x2568: ch
= 0xD0; break;
333 case 0x2569: ch
= 0xCA; break;
334 case 0x256A: ch
= 0xD8; break;
335 case 0x256B: ch
= 0xD7; break;
336 case 0x256C: ch
= 0xCE; break;
337 case 0x2580: ch
= 0xDF; break;
338 case 0x2584: ch
= 0xDC; break;
339 case 0x2588: ch
= 0xDB; break;
340 case 0x258C: ch
= 0xDD; break;
341 case 0x2590: ch
= 0xDE; break;
342 case 0x2591: ch
= 0xB0; break;
343 case 0x2592: ch
= 0xB1; break;
344 case 0x2593: ch
= 0xB2; break;
345 case 0x25A0: ch
= 0xFE; break;
346 case 0x25AC: ch
= 0x16; break;
347 case 0x25B2: ch
= 0x1E; break;
348 case 0x25BA: ch
= 0x10; break;
349 case 0x25BC: ch
= 0x1F; break;
350 case 0x25C4: ch
= 0x11; break;
351 case 0x25CB: ch
= 0x09; break;
352 case 0x25D8: ch
= 0x08; break;
353 case 0x25D9: ch
= 0x0A; break;
354 case 0x263A: ch
= 0x01; break;
355 case 0x263B: ch
= 0x02; break;
356 case 0x263C: ch
= 0x0F; break;
357 case 0x2640: ch
= 0x0C; break;
358 case 0x2642: ch
= 0x0B; break;
359 case 0x2660: ch
= 0x06; break;
360 case 0x2663: ch
= 0x05; break;
361 case 0x2665: ch
= 0x03; break;
362 case 0x2666: ch
= 0x04; break;
363 case 0x266A: ch
= 0x0D; break;
364 case 0x266B: ch
= 0x0E; break;
365 case 0xFFE8: ch
= 0xB3; break;
366 case 0xFFE9: ch
= 0x1B; break;
367 case 0xFFEA: ch
= 0x18; break;
368 case 0xFFEB: ch
= 0x1A; break;
369 case 0xFFEC: ch
= 0x19; break;
370 case 0xFFED: ch
= 0xFE; break;
371 case 0xFFEE: ch
= 0x09; break;
374 if(ch
>= 0xFF01 && ch
<= 0xFF5E)
378 HandleFallback (ref buffer
, chars
, ref charIndex
, ref charCount
, bytes
, ref byteIndex
, ref byteCount
);
385 bytes
[byteIndex
++] = (byte)ch
;
392 protected override void ToBytes(String s, int charIndex, int charCount,
393 byte[] bytes, int byteIndex)
398 ch = (int)(s[charIndex++]);
399 if(ch >= 26) switch(ch)
501 case 0x001A: ch = 0x7F; break;
502 case 0x001C: ch = 0x1A; break;
503 case 0x007F: ch = 0x1C; break;
504 case 0x00A0: ch = 0xFF; break;
505 case 0x00A2: ch = 0x9B; break;
506 case 0x00A3: ch = 0x9C; break;
507 case 0x00A4: ch = 0x98; break;
508 case 0x00A6: ch = 0xA0; break;
509 case 0x00A7: ch = 0x8F; break;
510 case 0x00A8: ch = 0xA4; break;
511 case 0x00AB: ch = 0xAE; break;
512 case 0x00AC: ch = 0xAA; break;
513 case 0x00AF: ch = 0xA7; break;
514 case 0x00B0: ch = 0xF8; break;
515 case 0x00B1: ch = 0xF1; break;
516 case 0x00B2: ch = 0xFD; break;
517 case 0x00B3: ch = 0xA6; break;
518 case 0x00B4: ch = 0xA1; break;
519 case 0x00B6: ch = 0x86; break;
520 case 0x00B7: ch = 0xFA; break;
521 case 0x00B8: ch = 0xA5; break;
522 case 0x00BB: ch = 0xAF; break;
523 case 0x00BC: ch = 0xAC; break;
524 case 0x00BD: ch = 0xAB; break;
525 case 0x00BE: ch = 0xAD; break;
526 case 0x00C0: ch = 0x8E; break;
527 case 0x00C2: ch = 0x84; break;
528 case 0x00C7: ch = 0x80; break;
529 case 0x00C8: ch = 0x91; break;
530 case 0x00C9: ch = 0x90; break;
531 case 0x00CA: ch = 0x92; break;
532 case 0x00CB: ch = 0x94; break;
533 case 0x00CE: ch = 0xA8; break;
534 case 0x00CF: ch = 0x95; break;
535 case 0x00D4: ch = 0x99; break;
536 case 0x00D9: ch = 0x9D; break;
537 case 0x00DB: ch = 0x9E; break;
538 case 0x00DC: ch = 0x9A; break;
539 case 0x00DF: ch = 0xE1; break;
540 case 0x00E0: ch = 0x85; break;
541 case 0x00E2: ch = 0x83; break;
542 case 0x00E7: ch = 0x87; break;
543 case 0x00E8: ch = 0x8A; break;
544 case 0x00E9: ch = 0x82; break;
545 case 0x00EA: ch = 0x88; break;
546 case 0x00EB: ch = 0x89; break;
547 case 0x00EE: ch = 0x8C; break;
548 case 0x00EF: ch = 0x8B; break;
549 case 0x00F3: ch = 0xA2; break;
550 case 0x00F4: ch = 0x93; break;
551 case 0x00F7: ch = 0xF6; break;
552 case 0x00F9: ch = 0x97; break;
553 case 0x00FA: ch = 0xA3; break;
554 case 0x00FB: ch = 0x96; break;
555 case 0x00FC: ch = 0x81; break;
556 case 0x0192: ch = 0x9F; break;
557 case 0x0393: ch = 0xE2; break;
558 case 0x0398: ch = 0xE9; break;
559 case 0x03A3: ch = 0xE4; break;
560 case 0x03A6: ch = 0xE8; break;
561 case 0x03A9: ch = 0xEA; break;
562 case 0x03B1: ch = 0xE0; break;
563 case 0x03B4: ch = 0xEB; break;
564 case 0x03B5: ch = 0xEE; break;
565 case 0x03BC: ch = 0xE6; break;
566 case 0x03C0: ch = 0xE3; break;
567 case 0x03C3: ch = 0xE5; break;
568 case 0x03C4: ch = 0xE7; break;
569 case 0x03C6: ch = 0xED; break;
570 case 0x2017: ch = 0x8D; break;
571 case 0x2022: ch = 0x07; break;
572 case 0x203C: ch = 0x13; break;
573 case 0x203E: ch = 0xA7; break;
574 case 0x207F: ch = 0xFC; break;
575 case 0x2190: ch = 0x1B; break;
576 case 0x2191: ch = 0x18; break;
577 case 0x2192: ch = 0x1A; break;
578 case 0x2193: ch = 0x19; break;
579 case 0x2194: ch = 0x1D; break;
580 case 0x2195: ch = 0x12; break;
581 case 0x21A8: ch = 0x17; break;
582 case 0x2219: ch = 0xF9; break;
583 case 0x221A: ch = 0xFB; break;
584 case 0x221E: ch = 0xEC; break;
585 case 0x221F: ch = 0x1C; break;
586 case 0x2229: ch = 0xEF; break;
587 case 0x2248: ch = 0xF7; break;
588 case 0x2261: ch = 0xF0; break;
589 case 0x2264: ch = 0xF3; break;
590 case 0x2265: ch = 0xF2; break;
591 case 0x2302: ch = 0x7F; break;
592 case 0x2310: ch = 0xA9; break;
593 case 0x2320: ch = 0xF4; break;
594 case 0x2321: ch = 0xF5; break;
595 case 0x2500: ch = 0xC4; break;
596 case 0x2502: ch = 0xB3; break;
597 case 0x250C: ch = 0xDA; break;
598 case 0x2510: ch = 0xBF; break;
599 case 0x2514: ch = 0xC0; break;
600 case 0x2518: ch = 0xD9; break;
601 case 0x251C: ch = 0xC3; break;
602 case 0x2524: ch = 0xB4; break;
603 case 0x252C: ch = 0xC2; break;
604 case 0x2534: ch = 0xC1; break;
605 case 0x253C: ch = 0xC5; break;
606 case 0x2550: ch = 0xCD; break;
607 case 0x2551: ch = 0xBA; break;
608 case 0x2552: ch = 0xD5; break;
609 case 0x2553: ch = 0xD6; break;
610 case 0x2554: ch = 0xC9; break;
611 case 0x2555: ch = 0xB8; break;
612 case 0x2556: ch = 0xB7; break;
613 case 0x2557: ch = 0xBB; break;
614 case 0x2558: ch = 0xD4; break;
615 case 0x2559: ch = 0xD3; break;
616 case 0x255A: ch = 0xC8; break;
617 case 0x255B: ch = 0xBE; break;
618 case 0x255C: ch = 0xBD; break;
619 case 0x255D: ch = 0xBC; break;
620 case 0x255E: ch = 0xC6; break;
621 case 0x255F: ch = 0xC7; break;
622 case 0x2560: ch = 0xCC; break;
623 case 0x2561: ch = 0xB5; break;
624 case 0x2562: ch = 0xB6; break;
625 case 0x2563: ch = 0xB9; break;
626 case 0x2564: ch = 0xD1; break;
627 case 0x2565: ch = 0xD2; break;
628 case 0x2566: ch = 0xCB; break;
629 case 0x2567: ch = 0xCF; break;
630 case 0x2568: ch = 0xD0; break;
631 case 0x2569: ch = 0xCA; break;
632 case 0x256A: ch = 0xD8; break;
633 case 0x256B: ch = 0xD7; break;
634 case 0x256C: ch = 0xCE; break;
635 case 0x2580: ch = 0xDF; break;
636 case 0x2584: ch = 0xDC; break;
637 case 0x2588: ch = 0xDB; break;
638 case 0x258C: ch = 0xDD; break;
639 case 0x2590: ch = 0xDE; break;
640 case 0x2591: ch = 0xB0; break;
641 case 0x2592: ch = 0xB1; break;
642 case 0x2593: ch = 0xB2; break;
643 case 0x25A0: ch = 0xFE; break;
644 case 0x25AC: ch = 0x16; break;
645 case 0x25B2: ch = 0x1E; break;
646 case 0x25BA: ch = 0x10; break;
647 case 0x25BC: ch = 0x1F; break;
648 case 0x25C4: ch = 0x11; break;
649 case 0x25CB: ch = 0x09; break;
650 case 0x25D8: ch = 0x08; break;
651 case 0x25D9: ch = 0x0A; break;
652 case 0x263A: ch = 0x01; break;
653 case 0x263B: ch = 0x02; break;
654 case 0x263C: ch = 0x0F; break;
655 case 0x2640: ch = 0x0C; break;
656 case 0x2642: ch = 0x0B; break;
657 case 0x2660: ch = 0x06; break;
658 case 0x2663: ch = 0x05; break;
659 case 0x2665: ch = 0x03; break;
660 case 0x2666: ch = 0x04; break;
661 case 0x266A: ch = 0x0D; break;
662 case 0x266B: ch = 0x0E; break;
663 case 0xFFE8: ch = 0xB3; break;
664 case 0xFFE9: ch = 0x1B; break;
665 case 0xFFEA: ch = 0x18; break;
666 case 0xFFEB: ch = 0x1A; break;
667 case 0xFFEC: ch = 0x19; break;
668 case 0xFFED: ch = 0xFE; break;
669 case 0xFFEE: ch = 0x09; break;
672 if(ch >= 0xFF01 && ch <= 0xFF5E)
679 bytes[byteIndex++] = (byte)ch;
688 public class ENCibm863
: CP863
690 public ENCibm863() : base() {}
692 }; // class ENCibm863
694 }; // namespace I18N.West