diff options
Diffstat (limited to 'tools/codepages.c')
-rw-r--r-- | tools/codepages.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/tools/codepages.c b/tools/codepages.c index 94768860f4..af181a7b7d 100644 --- a/tools/codepages.c +++ b/tools/codepages.c | |||
@@ -19,44 +19,12 @@ | |||
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <string.h> | 21 | #include <string.h> |
22 | #include "codepages.h" | 22 | #include "codepage_tables.h" |
23 | 23 | ||
24 | #define MAX_TABLE_SIZE 32768 | 24 | #define MAX_TABLE_SIZE 32768 |
25 | 25 | ||
26 | static unsigned short iso_table[MAX_TABLE_SIZE]; | 26 | static unsigned short iso_table[MAX_TABLE_SIZE]; |
27 | 27 | ||
28 | static const unsigned short iso8859_7_to_uni[] = { | ||
29 | 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, /* A1-A7 */ | ||
30 | 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, /* A8-AF */ | ||
31 | 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7 /* B0-B7 */ | ||
32 | }; | ||
33 | |||
34 | static const unsigned short cp1251_to_uni[] = { | ||
35 | 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, /* 80-87 */ | ||
36 | 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, /* 88-8F */ | ||
37 | 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, /* 90-97 */ | ||
38 | 0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, /* 98-9F */ | ||
39 | 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, /* A0-A7 */ | ||
40 | 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, /* A8-AF */ | ||
41 | 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, /* B0-B7 */ | ||
42 | 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457 /* B8-BF */ | ||
43 | }; | ||
44 | |||
45 | static const unsigned short iso8859_2_to_uni[] = { | ||
46 | 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, /* A1-A7 */ | ||
47 | 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, /* A8-AF */ | ||
48 | 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, /* B0-B7 */ | ||
49 | 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, /* B8-BF */ | ||
50 | 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, /* C0-C7 */ | ||
51 | 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, /* C8-CF */ | ||
52 | 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, /* D0-D7 */ | ||
53 | 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, /* D8-DF */ | ||
54 | 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, /* E0-E7 */ | ||
55 | 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, /* E8-EF */ | ||
56 | 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, /* F0-F7 */ | ||
57 | 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 /* F8-FF */ | ||
58 | }; | ||
59 | |||
60 | unsigned short iso_decode(unsigned char *latin1, int cp, int count) | 28 | unsigned short iso_decode(unsigned char *latin1, int cp, int count) |
61 | { | 29 | { |
62 | unsigned short ucs = 0; | 30 | unsigned short ucs = 0; |