annotate libutil/gsm7_encode_table.c @ 53:fbedb67d234f

serial: fix parity for inverse coding convention Important note: it is my (Mother Mychaela's) understanding that SIM cards with inverse coding convention are extremely rare, and I have never seen such a card. Therefore, our support for the inverse coding convention will likely remain forever untested.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Mar 2021 20:46:09 +0000
parents 34bbb0585cab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This library module contains the table for encoding from ISO 8859-1
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * into the GSM 7-bit default alphabet (03.38 or 23.038). High bit set
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * in the output indicates escape encoding, used for ASCII characters
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * [\]^ and {|}~. 0xFF indicates invalid chars.
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <sys/types.h>
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 u_char gsm7_encode_table[256] = {
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 0x00 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 0xFF, 0xFF, '\n', 0xFF, 0xFF, '\r', 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 0x10 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 ' ', '!', '"', '#', 0x02, '%', '&', 0x27, /* 0x20 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 '(', ')', '*', '+', ',', '-', '.', '/',
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 '0', '1', '2', '3', '4', '5', '6', '7', /* 0x30 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 '8', '9', ':', ';', '<', '=', '>', '?',
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G', /* 0x40 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', /* 0x50 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 'X', 'Y', 'Z', 0xBC, 0xAF, 0xBE, 0x94, 0x11,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 0xFF, 'a', 'b', 'c', 'd', 'e', 'f', 'g', /* 0x60 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', /* 0x70 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 'x', 'y', 'z', 0xA8, 0xC0, 0xA9, 0xBD, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 0x80 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 0x90 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 0xFF, 0x40, 0xFF, 0x01, 0x24, 0x03, 0xFF, 0x5F, /* 0xA0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* 0xB0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x60,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 0xFF, 0xFF, 0xFF, 0xFF, 0x5B, 0x0E, 0x1C, 0x09, /* 0xC0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 0xFF, 0x5D, 0xFF, 0xFF, 0xFF, 0xFF, 0x5C, 0xFF, /* 0xD0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 0x0B, 0xFF, 0xFF, 0xFF, 0x5E, 0xFF, 0xFF, 0x1E,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 0x7F, 0xFF, 0xFF, 0xFF, 0x7B, 0x0F, 0x1D, 0xFF, /* 0xE0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 0x04, 0x05, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF,
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 0xFF, 0x7D, 0x08, 0xFF, 0xFF, 0xFF, 0x7C, 0xFF, /* 0xF0 */
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 0x0C, 0x06, 0xFF, 0xFF, 0x7E, 0xFF, 0xFF, 0xFF
34bbb0585cab libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 };