Differences From Artifact [29dee94013]:
- File src/encodings/codepage_858.m — part of check-in [db5cf4d595] at 2017-02-12 22:33:17 on branch trunk — More efficient UTF-8 -> Codepage 858 conversion (user: js, size: 5575) [annotate] [blame] [check-ins using]
To Artifact [b4148204c6]:
- File
src/encodings/codepage_858.m
— part of check-in
[405d11522e]
at
2017-02-12 23:56:13
on branch trunk
— encodings: Make the page tables unsigned char[]
This also removes page.*Size, as the macros can just use sizeof() on the
arrays. (user: js, size: 5341) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
38 39 40 41 42 43 44 |
0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
};
const size_t of_codepage_858_table_offset =
256 - (sizeof(of_codepage_858_table) / sizeof(*of_codepage_858_table));
| | < | < | | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
};
const size_t of_codepage_858_table_offset =
256 - (sizeof(of_codepage_858_table) / sizeof(*of_codepage_858_table));
static const unsigned char page0[] = {
0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5,
0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE,
0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA,
0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8,
0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80,
0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8,
0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E,
0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1,
0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87,
0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B,
0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6,
0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98
};
static const uint8_t page0Start = 0xA0;
static const unsigned char page1[] = {
0x9F
};
static const uint8_t page1Start = 0x92;
static const unsigned char page20[] = {
0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| ︙ | ︙ | |||
83 84 85 86 87 88 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5 }; static const uint8_t page20Start = 0x17; | < | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xD5
};
static const uint8_t page20Start = 0x17;
static const unsigned char page25[] = {
0xC4, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xDA, 0x00, 0x00, 0x00,
0xBF, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
0xD9, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00,
|
| ︙ | ︙ | |||
109 110 111 112 113 114 115 | 0xDF, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xB1, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE }; static const uint8_t page25Start = 0x00; | < | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
0xDF, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00,
0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xB0, 0xB1, 0xB2, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFE
};
static const uint8_t page25Start = 0x00;
bool
of_unicode_to_codepage_858(const of_unichar_t *input, unsigned char *output,
size_t length, bool lossy)
{
for (size_t i = 0; i < length; i++) {
of_unichar_t c = input[i];
|
| ︙ | ︙ |