diff options
-rw-r--r-- | firmware/SOURCES | 1 | ||||
-rw-r--r-- | firmware/arabjoin.c | 199 | ||||
-rw-r--r-- | firmware/arabjoin.h | 205 | ||||
-rw-r--r-- | firmware/bidi.c | 8 | ||||
-rw-r--r-- | firmware/common/unicode.c | 22 | ||||
-rw-r--r-- | tools/Makefile | 2 | ||||
-rw-r--r-- | tools/codepage_tables.c (renamed from tools/codepages.h) | 44 | ||||
-rw-r--r-- | tools/codepages.c | 34 |
8 files changed, 258 insertions, 257 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 5a1c9adb7a..144b1c1032 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -48,6 +48,7 @@ drivers/lcd-player-charset.c | |||
48 | drivers/lcd-player.c | 48 | drivers/lcd-player.c |
49 | #endif | 49 | #endif |
50 | #ifdef HAVE_LCD_BITMAP | 50 | #ifdef HAVE_LCD_BITMAP |
51 | arabjoin.c | ||
51 | bidi.c | 52 | bidi.c |
52 | #if LCD_DEPTH == 2 | 53 | #if LCD_DEPTH == 2 |
53 | drivers/lcd-h100.c | 54 | drivers/lcd-h100.c |
diff --git a/firmware/arabjoin.c b/firmware/arabjoin.c new file mode 100644 index 0000000000..0aab5fab5c --- /dev/null +++ b/firmware/arabjoin.c | |||
@@ -0,0 +1,199 @@ | |||
1 | #include "arabjoin.h" | ||
2 | |||
3 | const arab_t zwj = {0x20,0x20,0x20,0x20}; //zero-width joiner | ||
4 | |||
5 | const arab_t lamaleph[] = { | ||
6 | {0xfefb,0xfefc,0,0}, | ||
7 | {0xfef9,0xfefa,0,0}, | ||
8 | {0xfef7,0xfef8,0,0}, | ||
9 | {0xfef5,0xfef6,0,0} | ||
10 | }; | ||
11 | |||
12 | const arab_t jointable[] = { | ||
13 | {0xfe80,0x0000,0x0000,0x0000}, // 0x0621 | ||
14 | {0xfe81,0xfe82,0x0000,0x0000}, // 0x0622 | ||
15 | {0xfe83,0xfe84,0x0000,0x0000}, // 0x0623 | ||
16 | {0xfe85,0xfe86,0x0000,0x0000}, // 0x0624 | ||
17 | {0xfe87,0xfe88,0x0000,0x0000}, // 0x0625 | ||
18 | {0xfe89,0xfe8a,0xfe8c,0xfe8b}, // 0x0626 | ||
19 | {0xfe8d,0xfe8e,0x0000,0x0000}, // 0x0627 | ||
20 | {0xfe8f,0xfe90,0xfe92,0xfe91}, // 0x0628 | ||
21 | {0xfe93,0xfe94,0x0000,0x0000}, // 0x0629 | ||
22 | {0xfe95,0xfe96,0xfe98,0xfe97}, // 0x062a | ||
23 | {0xfe99,0xfe9a,0xfe9c,0xfe9b}, // 0x062b | ||
24 | {0xfe9d,0xfe9e,0xfea0,0xfe9f}, // 0x062c | ||
25 | {0xfea1,0xfea2,0xfea4,0xfea3}, // 0x062d | ||
26 | {0xfea5,0xfea6,0xfea8,0xfea7}, // 0x062e | ||
27 | {0xfea9,0xfeaa,0x0000,0x0000}, // 0x062f | ||
28 | {0xfeab,0xfeac,0x0000,0x0000}, // 0x0630 | ||
29 | {0xfead,0xfeae,0x0000,0x0000}, // 0x0631 | ||
30 | {0xfeaf,0xfeb0,0x0000,0x0000}, // 0x0632 | ||
31 | {0xfeb1,0xfeb2,0xfeb4,0xfeb3}, // 0x0633 | ||
32 | {0xfeb5,0xfeb6,0xfeb8,0xfeb7}, // 0x0634 | ||
33 | {0xfeb9,0xfeba,0xfebc,0xfebb}, // 0x0635 | ||
34 | {0xfebd,0xfebe,0xfec0,0xfebf}, // 0x0636 | ||
35 | {0xfec1,0xfec2,0xfec4,0xfec3}, // 0x0637 | ||
36 | {0xfec5,0xfec6,0xfec8,0xfec7}, // 0x0638 | ||
37 | {0xfec9,0xfeca,0xfecc,0xfecb}, // 0x0639 | ||
38 | {0xfecd,0xfece,0xfed0,0xfecf}, // 0x063a | ||
39 | #if 0 | ||
40 | {0x0000,0x0000,0x0000,0x0000}, // 0x063b | ||
41 | {0x0000,0x0000,0x0000,0x0000}, // 0x063c | ||
42 | {0x0000,0x0000,0x0000,0x0000}, // 0x063d | ||
43 | {0x0000,0x0000,0x0000,0x0000}, // 0x063e | ||
44 | {0x0000,0x0000,0x0000,0x0000}, // 0x063f | ||
45 | #endif | ||
46 | {0x0640,0x0640,0x0640,0x0640}, // 0x0640 | ||
47 | {0xfed1,0xfed2,0xfed4,0xfed3}, // 0x0641 | ||
48 | {0xfed5,0xfed6,0xfed8,0xfed7}, // 0x0642 | ||
49 | {0xfed9,0xfeda,0xfedc,0xfedb}, // 0x0643 | ||
50 | {0xfedd,0xfede,0xfee0,0xfedf}, // 0x0644 | ||
51 | {0xfee1,0xfee2,0xfee4,0xfee3}, // 0x0645 | ||
52 | {0xfee5,0xfee6,0xfee8,0xfee7}, // 0x0646 | ||
53 | {0xfee9,0xfeea,0xfeec,0xfeeb}, // 0x0647 | ||
54 | {0xfeed,0xfeee,0x0000,0x0000}, // 0x0648 | ||
55 | {0xfeef,0xfef0,0x0000,0x0000}, // 0x0649 | ||
56 | {0xfef1,0xfef2,0xfef4,0xfef3}, // 0x064a | ||
57 | # if 0 | ||
58 | {0x0000,0x0000,0x0000,0x0000}, // 0x064b | ||
59 | {0x0000,0x0000,0x0000,0x0000}, // 0x064c | ||
60 | {0x0000,0x0000,0x0000,0x0000}, // 0x064d | ||
61 | {0x0000,0x0000,0x0000,0x0000}, // 0x064e | ||
62 | {0x0000,0x0000,0x0000,0x0000}, // 0x064f | ||
63 | {0x0000,0x0000,0x0000,0x0000}, // 0x0650 | ||
64 | {0x0000,0x0000,0x0000,0x0000}, // 0x0651 | ||
65 | {0x0000,0x0000,0x0000,0x0000}, // 0x0652 | ||
66 | {0x0000,0x0000,0x0000,0x0000}, // 0x0653 | ||
67 | {0x0000,0x0000,0x0000,0x0000}, // 0x0654 | ||
68 | {0x0000,0x0000,0x0000,0x0000}, // 0x0655 | ||
69 | {0x0000,0x0000,0x0000,0x0000}, // 0x0656 | ||
70 | {0x0000,0x0000,0x0000,0x0000}, // 0x0657 | ||
71 | {0x0000,0x0000,0x0000,0x0000}, // 0x0658 | ||
72 | {0x0000,0x0000,0x0000,0x0000}, // 0x0659 | ||
73 | {0x0000,0x0000,0x0000,0x0000}, // 0x065a | ||
74 | {0x0000,0x0000,0x0000,0x0000}, // 0x065b | ||
75 | {0x0000,0x0000,0x0000,0x0000}, // 0x065c | ||
76 | {0x0000,0x0000,0x0000,0x0000}, // 0x065d | ||
77 | {0x0000,0x0000,0x0000,0x0000}, // 0x065e | ||
78 | {0x0000,0x0000,0x0000,0x0000}, // 0x065f | ||
79 | {0x0000,0x0000,0x0000,0x0000}, // 0x0660 | ||
80 | {0x0000,0x0000,0x0000,0x0000}, // 0x0661 | ||
81 | {0x0000,0x0000,0x0000,0x0000}, // 0x0662 | ||
82 | {0x0000,0x0000,0x0000,0x0000}, // 0x0663 | ||
83 | {0x0000,0x0000,0x0000,0x0000}, // 0x0664 | ||
84 | {0x0000,0x0000,0x0000,0x0000}, // 0x0665 | ||
85 | {0x0000,0x0000,0x0000,0x0000}, // 0x0666 | ||
86 | {0x0000,0x0000,0x0000,0x0000}, // 0x0667 | ||
87 | {0x0000,0x0000,0x0000,0x0000}, // 0x0668 | ||
88 | {0x0000,0x0000,0x0000,0x0000}, // 0x0669 | ||
89 | {0x0000,0x0000,0x0000,0x0000}, // 0x066a | ||
90 | {0x0000,0x0000,0x0000,0x0000}, // 0x066b | ||
91 | {0x0000,0x0000,0x0000,0x0000}, // 0x066c | ||
92 | {0x0000,0x0000,0x0000,0x0000}, // 0x066d | ||
93 | {0x0000,0x0000,0x0000,0x0000}, // 0x066e | ||
94 | {0x0000,0x0000,0x0000,0x0000}, // 0x066f | ||
95 | {0x0000,0x0000,0x0000,0x0000}, // 0x0670 | ||
96 | #endif | ||
97 | {0xfb50,0x0000,0x0000,0x0000}, // 0x0671 | ||
98 | {0x0672,0x0672,0x0000,0x0000}, // 0x0672 | ||
99 | {0x0673,0x0673,0x0000,0x0000}, // 0x0673 | ||
100 | {0x0674,0x0000,0x0000,0x0000}, // 0x0674 | ||
101 | {0x0675,0x0675,0x0000,0x0000}, // 0x0675 | ||
102 | {0x0676,0x0676,0x0000,0x0000}, // 0x0676 | ||
103 | {0xfbdd,0x0677,0x0000,0x0000}, // 0x0677 | ||
104 | {0x0678,0x0678,0x0678,0x0678}, // 0x0678 | ||
105 | {0xfb66,0xfb67,0xfb69,0xfb68}, // 0x0679 | ||
106 | {0xfb5e,0xfb5f,0xfb61,0xfb60}, // 0x067a | ||
107 | {0xfb52,0xfb53,0xfb55,0xfb54}, // 0x067b | ||
108 | {0x067c,0x067c,0x067c,0x067c}, // 0x067c | ||
109 | {0x067d,0x067d,0x067d,0x067d}, // 0x067d | ||
110 | {0xfb56,0xfb57,0xfb59,0xfb58}, // 0x067e | ||
111 | {0xfb62,0xfb63,0xfb65,0xfb64}, // 0x067f | ||
112 | {0xfb5a,0xfb5b,0xfb5d,0xfb5c}, // 0x0680 | ||
113 | {0x0681,0x0681,0x0681,0x0681}, // 0x0681 | ||
114 | {0x0682,0x0682,0x0682,0x0682}, // 0x0682 | ||
115 | {0xfb76,0xfb77,0xfb79,0xfb78}, // 0x0683 | ||
116 | {0xfb72,0xfb73,0xfb75,0xfb74}, // 0x0684 | ||
117 | {0x0685,0x0685,0x0685,0x0685}, // 0x0685 | ||
118 | {0xfb7a,0xfb7b,0xfb7d,0xfb7c}, // 0x0686 | ||
119 | {0xfb7e,0xfb7f,0xfb81,0xfb80}, // 0x0687 | ||
120 | {0xfb88,0xfb89,0x0000,0x0000}, // 0x0688 | ||
121 | {0x0689,0x0689,0x0000,0x0000}, // 0x0689 | ||
122 | {0x068a,0x068a,0x0000,0x0000}, // 0x068a | ||
123 | {0x068b,0x068b,0x0000,0x0000}, // 0x068b | ||
124 | {0xfb84,0xfb85,0x0000,0x0000}, // 0x068c | ||
125 | {0xfb82,0xfb83,0x0000,0x0000}, // 0x068d | ||
126 | {0xfb86,0xfb87,0x0000,0x0000}, // 0x068e | ||
127 | {0x068f,0x068f,0x0000,0x0000}, // 0x068f | ||
128 | {0x0690,0x0690,0x0000,0x0000}, // 0x0690 | ||
129 | {0xfb8c,0xfb8d,0x0000,0x0000}, // 0x0691 | ||
130 | {0x0692,0x0692,0x0000,0x0000}, // 0x0692 | ||
131 | {0x0693,0x0693,0x0000,0x0000}, // 0x0693 | ||
132 | {0x0694,0x0694,0x0000,0x0000}, // 0x0694 | ||
133 | {0x0695,0x0695,0x0000,0x0000}, // 0x0695 | ||
134 | {0x0695,0x0696,0x0000,0x0000}, // 0x0696 | ||
135 | {0x0697,0x0697,0x0000,0x0000}, // 0x0697 | ||
136 | {0xfb8a,0xfb8b,0x0000,0x0000}, // 0x0698 | ||
137 | {0x0699,0x0699,0x0000,0x0000}, // 0x0699 | ||
138 | {0x069a,0x069a,0x069a,0x069a}, // 0x069a | ||
139 | {0x069b,0x069b,0x069b,0x069b}, // 0x069b | ||
140 | {0x069c,0x069c,0x069c,0x069c}, // 0x069c | ||
141 | {0x069d,0x069d,0x069d,0x069d}, // 0x069d | ||
142 | {0x069e,0x069e,0x069e,0x069e}, // 0x069e | ||
143 | {0x069f,0x069f,0x069f,0x069f}, // 0x069f | ||
144 | {0x06a0,0x06a0,0x06a0,0x06a0}, // 0x06a0 | ||
145 | {0x06a1,0x06a1,0x06a1,0x06a1}, // 0x06a1 | ||
146 | {0x06a2,0x06a2,0x06a2,0x06a2}, // 0x06a2 | ||
147 | {0x06a3,0x06a3,0x06a3,0x06a3}, // 0x06a3 | ||
148 | {0xfb6a,0xfb6b,0xfb6d,0xfb6c}, // 0x06a4 | ||
149 | {0x06a5,0x06a5,0x06a5,0x06a5}, // 0x06a5 | ||
150 | {0xfb6e,0xfb6f,0xfb71,0xfb70}, // 0x06a6 | ||
151 | {0x06a7,0x06a7,0x06a7,0x06a7}, // 0x06a7 | ||
152 | {0x06a8,0x06a8,0x06a8,0x06a8}, // 0x06a8 | ||
153 | {0xfb8e,0xfb8f,0xfb91,0xfb90}, // 0x06a9 | ||
154 | {0x06aa,0x06aa,0x06aa,0x06aa}, // 0x06aa | ||
155 | {0x06ab,0x06ab,0x06ab,0x06ab}, // 0x06ab | ||
156 | {0x06ac,0x06ac,0x06ac,0x06ac}, // 0x06ac | ||
157 | {0xfbd3,0xfbd4,0xfbd6,0xfbd5}, // 0x06ad | ||
158 | {0x06ae,0x06ae,0x06ae,0x06ae}, // 0x06ae | ||
159 | {0xfb92,0xfb93,0xfb95,0xfb94}, // 0x06af | ||
160 | {0x06b0,0x06b0,0x06b0,0x06b0}, // 0x06b0 | ||
161 | {0xfb9a,0xfb9b,0xfb9d,0xfb9c}, // 0x06b1 | ||
162 | {0x06b2,0x06b2,0x06b2,0x06b2}, // 0x06b2 | ||
163 | {0xfb96,0xfb97,0xfb99,0xfb98}, // 0x06b3 | ||
164 | {0x06b4,0x06b4,0x06b4,0x06b4}, // 0x06b4 | ||
165 | {0x06b5,0x06b5,0x06b5,0x06b5}, // 0x06b5 | ||
166 | {0x06b6,0x06b6,0x06b6,0x06b6}, // 0x06b6 | ||
167 | {0x06b7,0x06b7,0x06b7,0x06b7}, // 0x06b7 | ||
168 | {0x0000,0x0000,0x0000,0x0000}, // 0x06b8 | ||
169 | {0x0000,0x0000,0x0000,0x0000}, // 0x06b9 | ||
170 | {0xfb9e,0xfb9f,0x06ba,0x06ba}, // 0x06ba | ||
171 | {0xfba0,0xfba1,0xfba3,0xfba2}, // 0x06bb | ||
172 | {0x06bc,0x06bc,0x06bc,0x06bc}, // 0x06bc | ||
173 | {0x06bd,0x06bd,0x06bd,0x06bd}, // 0x06bd | ||
174 | {0xfbaa,0xfbab,0xfbad,0xfbac}, // 0x06be | ||
175 | {0x0000,0x0000,0x0000,0x0000}, // 0x06bf | ||
176 | {0xfba4,0xfba5,0x0000,0x0000}, // 0x06c0 | ||
177 | {0x06c1,0x06c1,0x06c1,0x06c1}, // 0x06c1 | ||
178 | {0x06c2,0x06c2,0x0000,0x0000}, // 0x06c2 | ||
179 | {0x06c3,0x06c3,0x0000,0x0000}, // 0x06c3 | ||
180 | {0x06c4,0x06c4,0x0000,0x0000}, // 0x06c4 | ||
181 | {0x06c5,0x06c5,0x0000,0x0000}, // 0x06c5 | ||
182 | {0x06c6,0x06c6,0x0000,0x0000}, // 0x06c6 | ||
183 | {0x06c7,0x06c7,0x0000,0x0000}, // 0x06c7 | ||
184 | {0x06c8,0x06c8,0x0000,0x0000}, // 0x06c8 | ||
185 | {0x06c9,0x06c9,0x0000,0x0000}, // 0x06c9 | ||
186 | {0x06ca,0x06ca,0x0000,0x0000}, // 0x06ca | ||
187 | {0x06cb,0x06cb,0x0000,0x0000}, // 0x06cb | ||
188 | {0x06cc,0x06cc,0x06cc,0x06cc}, // 0x06cc | ||
189 | {0x06cd,0x06cd,0x0000,0x0000}, // 0x06cd | ||
190 | {0x06ce,0x06ce,0x06ce,0x06ce}, // 0x06ce | ||
191 | {0x0000,0x0000,0x0000,0x0000}, // 0x06cf | ||
192 | {0x06d0,0x06d0,0x06d0,0x06d0}, // 0x06d0 | ||
193 | {0x06d1,0x06d1,0x06d1,0x06d1}, // 0x06d1 | ||
194 | {0xfbae,0xfbaf,0x0000,0x0000}, // 0x06d2 | ||
195 | {0xfbb0,0xfbb1,0x0000,0x0000}, // 0x06d3 | ||
196 | {0x0000,0x0000,0x0000,0x0000}, // 0x06d4 | ||
197 | {0x06d5,0x0000,0x0000,0x0000} // 0x06d5 | ||
198 | }; | ||
199 | |||
diff --git a/firmware/arabjoin.h b/firmware/arabjoin.h index cba498660c..e69de29bb2 100644 --- a/firmware/arabjoin.h +++ b/firmware/arabjoin.h | |||
@@ -1,205 +0,0 @@ | |||
1 | typedef struct { | ||
2 | unsigned short isolated; | ||
3 | unsigned short final; | ||
4 | unsigned short medial; | ||
5 | unsigned short initial; | ||
6 | } arab_t; | ||
7 | |||
8 | //static arab_t dummy = {0,0,0,0}; | ||
9 | static arab_t zwj = {0x20,0x20,0x20,0x20}; //zero-width joiner | ||
10 | |||
11 | static arab_t lamaleph[] = { | ||
12 | {0xfefb,0xfefc,0,0}, | ||
13 | {0xfef9,0xfefa,0,0}, | ||
14 | {0xfef7,0xfef8,0,0}, | ||
15 | {0xfef5,0xfef6,0,0} | ||
16 | }; | ||
17 | |||
18 | static arab_t jointable[] = { | ||
19 | {0xfe80,0x0000,0x0000,0x0000}, // 0x0621 | ||
20 | {0xfe81,0xfe82,0x0000,0x0000}, // 0x0622 | ||
21 | {0xfe83,0xfe84,0x0000,0x0000}, // 0x0623 | ||
22 | {0xfe85,0xfe86,0x0000,0x0000}, // 0x0624 | ||
23 | {0xfe87,0xfe88,0x0000,0x0000}, // 0x0625 | ||
24 | {0xfe89,0xfe8a,0xfe8c,0xfe8b}, // 0x0626 | ||
25 | {0xfe8d,0xfe8e,0x0000,0x0000}, // 0x0627 | ||
26 | {0xfe8f,0xfe90,0xfe92,0xfe91}, // 0x0628 | ||
27 | {0xfe93,0xfe94,0x0000,0x0000}, // 0x0629 | ||
28 | {0xfe95,0xfe96,0xfe98,0xfe97}, // 0x062a | ||
29 | {0xfe99,0xfe9a,0xfe9c,0xfe9b}, // 0x062b | ||
30 | {0xfe9d,0xfe9e,0xfea0,0xfe9f}, // 0x062c | ||
31 | {0xfea1,0xfea2,0xfea4,0xfea3}, // 0x062d | ||
32 | {0xfea5,0xfea6,0xfea8,0xfea7}, // 0x062e | ||
33 | {0xfea9,0xfeaa,0x0000,0x0000}, // 0x062f | ||
34 | {0xfeab,0xfeac,0x0000,0x0000}, // 0x0630 | ||
35 | {0xfead,0xfeae,0x0000,0x0000}, // 0x0631 | ||
36 | {0xfeaf,0xfeb0,0x0000,0x0000}, // 0x0632 | ||
37 | {0xfeb1,0xfeb2,0xfeb4,0xfeb3}, // 0x0633 | ||
38 | {0xfeb5,0xfeb6,0xfeb8,0xfeb7}, // 0x0634 | ||
39 | {0xfeb9,0xfeba,0xfebc,0xfebb}, // 0x0635 | ||
40 | {0xfebd,0xfebe,0xfec0,0xfebf}, // 0x0636 | ||
41 | {0xfec1,0xfec2,0xfec4,0xfec3}, // 0x0637 | ||
42 | {0xfec5,0xfec6,0xfec8,0xfec7}, // 0x0638 | ||
43 | {0xfec9,0xfeca,0xfecc,0xfecb}, // 0x0639 | ||
44 | {0xfecd,0xfece,0xfed0,0xfecf}, // 0x063a | ||
45 | #if 0 | ||
46 | {0x0000,0x0000,0x0000,0x0000}, // 0x063b | ||
47 | {0x0000,0x0000,0x0000,0x0000}, // 0x063c | ||
48 | {0x0000,0x0000,0x0000,0x0000}, // 0x063d | ||
49 | {0x0000,0x0000,0x0000,0x0000}, // 0x063e | ||
50 | {0x0000,0x0000,0x0000,0x0000}, // 0x063f | ||
51 | #endif | ||
52 | {0x0640,0x0640,0x0640,0x0640}, // 0x0640 | ||
53 | {0xfed1,0xfed2,0xfed4,0xfed3}, // 0x0641 | ||
54 | {0xfed5,0xfed6,0xfed8,0xfed7}, // 0x0642 | ||
55 | {0xfed9,0xfeda,0xfedc,0xfedb}, // 0x0643 | ||
56 | {0xfedd,0xfede,0xfee0,0xfedf}, // 0x0644 | ||
57 | {0xfee1,0xfee2,0xfee4,0xfee3}, // 0x0645 | ||
58 | {0xfee5,0xfee6,0xfee8,0xfee7}, // 0x0646 | ||
59 | {0xfee9,0xfeea,0xfeec,0xfeeb}, // 0x0647 | ||
60 | {0xfeed,0xfeee,0x0000,0x0000}, // 0x0648 | ||
61 | {0xfeef,0xfef0,0x0000,0x0000}, // 0x0649 | ||
62 | {0xfef1,0xfef2,0xfef4,0xfef3}, // 0x064a | ||
63 | # if 0 | ||
64 | {0x0000,0x0000,0x0000,0x0000}, // 0x064b | ||
65 | {0x0000,0x0000,0x0000,0x0000}, // 0x064c | ||
66 | {0x0000,0x0000,0x0000,0x0000}, // 0x064d | ||
67 | {0x0000,0x0000,0x0000,0x0000}, // 0x064e | ||
68 | {0x0000,0x0000,0x0000,0x0000}, // 0x064f | ||
69 | {0x0000,0x0000,0x0000,0x0000}, // 0x0650 | ||
70 | {0x0000,0x0000,0x0000,0x0000}, // 0x0651 | ||
71 | {0x0000,0x0000,0x0000,0x0000}, // 0x0652 | ||
72 | {0x0000,0x0000,0x0000,0x0000}, // 0x0653 | ||
73 | {0x0000,0x0000,0x0000,0x0000}, // 0x0654 | ||
74 | {0x0000,0x0000,0x0000,0x0000}, // 0x0655 | ||
75 | {0x0000,0x0000,0x0000,0x0000}, // 0x0656 | ||
76 | {0x0000,0x0000,0x0000,0x0000}, // 0x0657 | ||
77 | {0x0000,0x0000,0x0000,0x0000}, // 0x0658 | ||
78 | {0x0000,0x0000,0x0000,0x0000}, // 0x0659 | ||
79 | {0x0000,0x0000,0x0000,0x0000}, // 0x065a | ||
80 | {0x0000,0x0000,0x0000,0x0000}, // 0x065b | ||
81 | {0x0000,0x0000,0x0000,0x0000}, // 0x065c | ||
82 | {0x0000,0x0000,0x0000,0x0000}, // 0x065d | ||
83 | {0x0000,0x0000,0x0000,0x0000}, // 0x065e | ||
84 | {0x0000,0x0000,0x0000,0x0000}, // 0x065f | ||
85 | {0x0000,0x0000,0x0000,0x0000}, // 0x0660 | ||
86 | {0x0000,0x0000,0x0000,0x0000}, // 0x0661 | ||
87 | {0x0000,0x0000,0x0000,0x0000}, // 0x0662 | ||
88 | {0x0000,0x0000,0x0000,0x0000}, // 0x0663 | ||
89 | {0x0000,0x0000,0x0000,0x0000}, // 0x0664 | ||
90 | {0x0000,0x0000,0x0000,0x0000}, // 0x0665 | ||
91 | {0x0000,0x0000,0x0000,0x0000}, // 0x0666 | ||
92 | {0x0000,0x0000,0x0000,0x0000}, // 0x0667 | ||
93 | {0x0000,0x0000,0x0000,0x0000}, // 0x0668 | ||
94 | {0x0000,0x0000,0x0000,0x0000}, // 0x0669 | ||
95 | {0x0000,0x0000,0x0000,0x0000}, // 0x066a | ||
96 | {0x0000,0x0000,0x0000,0x0000}, // 0x066b | ||
97 | {0x0000,0x0000,0x0000,0x0000}, // 0x066c | ||
98 | {0x0000,0x0000,0x0000,0x0000}, // 0x066d | ||
99 | {0x0000,0x0000,0x0000,0x0000}, // 0x066e | ||
100 | {0x0000,0x0000,0x0000,0x0000}, // 0x066f | ||
101 | {0x0000,0x0000,0x0000,0x0000}, // 0x0670 | ||
102 | #endif | ||
103 | {0xfb50,0x0000,0x0000,0x0000}, // 0x0671 | ||
104 | {0x0672,0x0672,0x0000,0x0000}, // 0x0672 | ||
105 | {0x0673,0x0673,0x0000,0x0000}, // 0x0673 | ||
106 | {0x0674,0x0000,0x0000,0x0000}, // 0x0674 | ||
107 | {0x0675,0x0675,0x0000,0x0000}, // 0x0675 | ||
108 | {0x0676,0x0676,0x0000,0x0000}, // 0x0676 | ||
109 | {0xfbdd,0x0677,0x0000,0x0000}, // 0x0677 | ||
110 | {0x0678,0x0678,0x0678,0x0678}, // 0x0678 | ||
111 | {0xfb66,0xfb67,0xfb69,0xfb68}, // 0x0679 | ||
112 | {0xfb5e,0xfb5f,0xfb61,0xfb60}, // 0x067a | ||
113 | {0xfb52,0xfb53,0xfb55,0xfb54}, // 0x067b | ||
114 | {0x067c,0x067c,0x067c,0x067c}, // 0x067c | ||
115 | {0x067d,0x067d,0x067d,0x067d}, // 0x067d | ||
116 | {0xfb56,0xfb57,0xfb59,0xfb58}, // 0x067e | ||
117 | {0xfb62,0xfb63,0xfb65,0xfb64}, // 0x067f | ||
118 | {0xfb5a,0xfb5b,0xfb5d,0xfb5c}, // 0x0680 | ||
119 | {0x0681,0x0681,0x0681,0x0681}, // 0x0681 | ||
120 | {0x0682,0x0682,0x0682,0x0682}, // 0x0682 | ||
121 | {0xfb76,0xfb77,0xfb79,0xfb78}, // 0x0683 | ||
122 | {0xfb72,0xfb73,0xfb75,0xfb74}, // 0x0684 | ||
123 | {0x0685,0x0685,0x0685,0x0685}, // 0x0685 | ||
124 | {0xfb7a,0xfb7b,0xfb7d,0xfb7c}, // 0x0686 | ||
125 | {0xfb7e,0xfb7f,0xfb81,0xfb80}, // 0x0687 | ||
126 | {0xfb88,0xfb89,0x0000,0x0000}, // 0x0688 | ||
127 | {0x0689,0x0689,0x0000,0x0000}, // 0x0689 | ||
128 | {0x068a,0x068a,0x0000,0x0000}, // 0x068a | ||
129 | {0x068b,0x068b,0x0000,0x0000}, // 0x068b | ||
130 | {0xfb84,0xfb85,0x0000,0x0000}, // 0x068c | ||
131 | {0xfb82,0xfb83,0x0000,0x0000}, // 0x068d | ||
132 | {0xfb86,0xfb87,0x0000,0x0000}, // 0x068e | ||
133 | {0x068f,0x068f,0x0000,0x0000}, // 0x068f | ||
134 | {0x0690,0x0690,0x0000,0x0000}, // 0x0690 | ||
135 | {0xfb8c,0xfb8d,0x0000,0x0000}, // 0x0691 | ||
136 | {0x0692,0x0692,0x0000,0x0000}, // 0x0692 | ||
137 | {0x0693,0x0693,0x0000,0x0000}, // 0x0693 | ||
138 | {0x0694,0x0694,0x0000,0x0000}, // 0x0694 | ||
139 | {0x0695,0x0695,0x0000,0x0000}, // 0x0695 | ||
140 | {0x0695,0x0696,0x0000,0x0000}, // 0x0696 | ||
141 | {0x0697,0x0697,0x0000,0x0000}, // 0x0697 | ||
142 | {0xfb8a,0xfb8b,0x0000,0x0000}, // 0x0698 | ||
143 | {0x0699,0x0699,0x0000,0x0000}, // 0x0699 | ||
144 | {0x069a,0x069a,0x069a,0x069a}, // 0x069a | ||
145 | {0x069b,0x069b,0x069b,0x069b}, // 0x069b | ||
146 | {0x069c,0x069c,0x069c,0x069c}, // 0x069c | ||
147 | {0x069d,0x069d,0x069d,0x069d}, // 0x069d | ||
148 | {0x069e,0x069e,0x069e,0x069e}, // 0x069e | ||
149 | {0x069f,0x069f,0x069f,0x069f}, // 0x069f | ||
150 | {0x06a0,0x06a0,0x06a0,0x06a0}, // 0x06a0 | ||
151 | {0x06a1,0x06a1,0x06a1,0x06a1}, // 0x06a1 | ||
152 | {0x06a2,0x06a2,0x06a2,0x06a2}, // 0x06a2 | ||
153 | {0x06a3,0x06a3,0x06a3,0x06a3}, // 0x06a3 | ||
154 | {0xfb6a,0xfb6b,0xfb6d,0xfb6c}, // 0x06a4 | ||
155 | {0x06a5,0x06a5,0x06a5,0x06a5}, // 0x06a5 | ||
156 | {0xfb6e,0xfb6f,0xfb71,0xfb70}, // 0x06a6 | ||
157 | {0x06a7,0x06a7,0x06a7,0x06a7}, // 0x06a7 | ||
158 | {0x06a8,0x06a8,0x06a8,0x06a8}, // 0x06a8 | ||
159 | {0xfb8e,0xfb8f,0xfb91,0xfb90}, // 0x06a9 | ||
160 | {0x06aa,0x06aa,0x06aa,0x06aa}, // 0x06aa | ||
161 | {0x06ab,0x06ab,0x06ab,0x06ab}, // 0x06ab | ||
162 | {0x06ac,0x06ac,0x06ac,0x06ac}, // 0x06ac | ||
163 | {0xfbd3,0xfbd4,0xfbd6,0xfbd5}, // 0x06ad | ||
164 | {0x06ae,0x06ae,0x06ae,0x06ae}, // 0x06ae | ||
165 | {0xfb92,0xfb93,0xfb95,0xfb94}, // 0x06af | ||
166 | {0x06b0,0x06b0,0x06b0,0x06b0}, // 0x06b0 | ||
167 | {0xfb9a,0xfb9b,0xfb9d,0xfb9c}, // 0x06b1 | ||
168 | {0x06b2,0x06b2,0x06b2,0x06b2}, // 0x06b2 | ||
169 | {0xfb96,0xfb97,0xfb99,0xfb98}, // 0x06b3 | ||
170 | {0x06b4,0x06b4,0x06b4,0x06b4}, // 0x06b4 | ||
171 | {0x06b5,0x06b5,0x06b5,0x06b5}, // 0x06b5 | ||
172 | {0x06b6,0x06b6,0x06b6,0x06b6}, // 0x06b6 | ||
173 | {0x06b7,0x06b7,0x06b7,0x06b7}, // 0x06b7 | ||
174 | {0x0000,0x0000,0x0000,0x0000}, // 0x06b8 | ||
175 | {0x0000,0x0000,0x0000,0x0000}, // 0x06b9 | ||
176 | {0xfb9e,0xfb9f,0x06ba,0x06ba}, // 0x06ba | ||
177 | {0xfba0,0xfba1,0xfba3,0xfba2}, // 0x06bb | ||
178 | {0x06bc,0x06bc,0x06bc,0x06bc}, // 0x06bc | ||
179 | {0x06bd,0x06bd,0x06bd,0x06bd}, // 0x06bd | ||
180 | {0xfbaa,0xfbab,0xfbad,0xfbac}, // 0x06be | ||
181 | {0x0000,0x0000,0x0000,0x0000}, // 0x06bf | ||
182 | {0xfba4,0xfba5,0x0000,0x0000}, // 0x06c0 | ||
183 | {0x06c1,0x06c1,0x06c1,0x06c1}, // 0x06c1 | ||
184 | {0x06c2,0x06c2,0x0000,0x0000}, // 0x06c2 | ||
185 | {0x06c3,0x06c3,0x0000,0x0000}, // 0x06c3 | ||
186 | {0x06c4,0x06c4,0x0000,0x0000}, // 0x06c4 | ||
187 | {0x06c5,0x06c5,0x0000,0x0000}, // 0x06c5 | ||
188 | {0x06c6,0x06c6,0x0000,0x0000}, // 0x06c6 | ||
189 | {0x06c7,0x06c7,0x0000,0x0000}, // 0x06c7 | ||
190 | {0x06c8,0x06c8,0x0000,0x0000}, // 0x06c8 | ||
191 | {0x06c9,0x06c9,0x0000,0x0000}, // 0x06c9 | ||
192 | {0x06ca,0x06ca,0x0000,0x0000}, // 0x06ca | ||
193 | {0x06cb,0x06cb,0x0000,0x0000}, // 0x06cb | ||
194 | {0x06cc,0x06cc,0x06cc,0x06cc}, // 0x06cc | ||
195 | {0x06cd,0x06cd,0x0000,0x0000}, // 0x06cd | ||
196 | {0x06ce,0x06ce,0x06ce,0x06ce}, // 0x06ce | ||
197 | {0x0000,0x0000,0x0000,0x0000}, // 0x06cf | ||
198 | {0x06d0,0x06d0,0x06d0,0x06d0}, // 0x06d0 | ||
199 | {0x06d1,0x06d1,0x06d1,0x06d1}, // 0x06d1 | ||
200 | {0xfbae,0xfbaf,0x0000,0x0000}, // 0x06d2 | ||
201 | {0xfbb0,0xfbb1,0x0000,0x0000}, // 0x06d3 | ||
202 | {0x0000,0x0000,0x0000,0x0000}, // 0x06d4 | ||
203 | {0x06d5,0x0000,0x0000,0x0000} // 0x06d5 | ||
204 | }; | ||
205 | |||
diff --git a/firmware/bidi.c b/firmware/bidi.c index 93c1dd0951..d2458e8963 100644 --- a/firmware/bidi.c +++ b/firmware/bidi.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0) | 38 | #define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0) |
39 | #define XOR(a,b) ((a||b) && !(a&&b)) | 39 | #define XOR(a,b) ((a||b) && !(a&&b)) |
40 | 40 | ||
41 | arab_t * arab_lookup(unsigned short uchar) | 41 | const arab_t * arab_lookup(unsigned short uchar) |
42 | { | 42 | { |
43 | if (uchar >= 0x621 && uchar <= 0x63a) | 43 | if (uchar >= 0x621 && uchar <= 0x63a) |
44 | return &(jointable[uchar - 0x621]); | 44 | return &(jointable[uchar - 0x621]); |
@@ -56,9 +56,9 @@ void arabjoin(unsigned short * stringprt, int length){ | |||
56 | bool connected = false; | 56 | bool connected = false; |
57 | unsigned short * writeprt = stringprt; | 57 | unsigned short * writeprt = stringprt; |
58 | 58 | ||
59 | arab_t * prev = 0; | 59 | const arab_t * prev = 0; |
60 | arab_t * cur; | 60 | const arab_t * cur; |
61 | arab_t * ligature = 0; | 61 | const arab_t * ligature = 0; |
62 | short uchar; | 62 | short uchar; |
63 | 63 | ||
64 | int i; | 64 | int i; |
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c index a82327e1b1..4e1b78f9e1 100644 --- a/firmware/common/unicode.c +++ b/firmware/common/unicode.c | |||
@@ -73,7 +73,8 @@ int load_cp_table(int cp) | |||
73 | 73 | ||
74 | while (i < tablesize) { | 74 | while (i < tablesize) { |
75 | if (!read(file, tmp, 2)) { | 75 | if (!read(file, tmp, 2)) { |
76 | DEBUGF("Can't read from codepage file: %s.cp\n", filename[table-1]); | 76 | DEBUGF("Can't read from codepage file: %s.cp\n", |
77 | filename[table-1]); | ||
77 | loaded_cp_table = 0; | 78 | loaded_cp_table = 0; |
78 | return 0; | 79 | return 0; |
79 | } | 80 | } |
@@ -170,13 +171,16 @@ unsigned char* iso_decode(const unsigned char *iso, unsigned char *utf8, | |||
170 | } | 171 | } |
171 | 172 | ||
172 | /* Recode a UTF-16 string with little-endian byte ordering to UTF-8 */ | 173 | /* Recode a UTF-16 string with little-endian byte ordering to UTF-8 */ |
173 | unsigned char* utf16LEdecode(const unsigned char *utf16, unsigned char *utf8, unsigned int count) | 174 | unsigned char* utf16LEdecode(const unsigned char *utf16, unsigned char *utf8, |
175 | unsigned int count) | ||
174 | { | 176 | { |
175 | unsigned long ucs; | 177 | unsigned long ucs; |
176 | 178 | ||
177 | while (count != 0) { | 179 | while (count != 0) { |
178 | if (utf16[1] >= 0xD8 && utf16[1] < 0xE0) { /* Check for a surrogate pair */ | 180 | /* Check for a surrogate pair */ |
179 | ucs = 0x10000 + ((utf16[0] << 10) | ((utf16[1] - 0xD8) << 18) | utf16[2] | ((utf16[3] - 0xDC) << 8)); | 181 | if (utf16[1] >= 0xD8 && utf16[1] < 0xE0) { |
182 | ucs = 0x10000 + ((utf16[0] << 10) | ((utf16[1] - 0xD8) << 18) | ||
183 | | utf16[2] | ((utf16[3] - 0xDC) << 8)); | ||
180 | utf16 += 4; | 184 | utf16 += 4; |
181 | count -= 2; | 185 | count -= 2; |
182 | } else { | 186 | } else { |
@@ -190,13 +194,15 @@ unsigned char* utf16LEdecode(const unsigned char *utf16, unsigned char *utf8, un | |||
190 | } | 194 | } |
191 | 195 | ||
192 | /* Recode a UTF-16 string with big-endian byte ordering to UTF-8 */ | 196 | /* Recode a UTF-16 string with big-endian byte ordering to UTF-8 */ |
193 | unsigned char* utf16BEdecode(const unsigned char *utf16, unsigned char *utf8, unsigned int count) | 197 | unsigned char* utf16BEdecode(const unsigned char *utf16, unsigned char *utf8, |
198 | unsigned int count) | ||
194 | { | 199 | { |
195 | unsigned long ucs; | 200 | unsigned long ucs; |
196 | 201 | ||
197 | while (count != 0) { | 202 | while (count != 0) { |
198 | if (*utf16 >= 0xD8 && *utf16 < 0xE0) { /* Check for a surrogate pair */ | 203 | if (*utf16 >= 0xD8 && *utf16 < 0xE0) { /* Check for a surrogate pair */ |
199 | ucs = 0x10000 + (((utf16[0] - 0xD8) << 18) | (utf16[1] << 10) | ((utf16[2] - 0xDC) << 8) | utf16[3]); | 204 | ucs = 0x10000 + (((utf16[0] - 0xD8) << 18) | (utf16[1] << 10) |
205 | | ((utf16[2] - 0xDC) << 8) | utf16[3]); | ||
200 | utf16 += 4; | 206 | utf16 += 4; |
201 | count -= 2; | 207 | count -= 2; |
202 | } else { | 208 | } else { |
@@ -210,8 +216,8 @@ unsigned char* utf16BEdecode(const unsigned char *utf16, unsigned char *utf8, un | |||
210 | } | 216 | } |
211 | 217 | ||
212 | /* Recode any UTF-16 string to UTF-8 */ | 218 | /* Recode any UTF-16 string to UTF-8 */ |
213 | //unsigned char* utf16decode(unsigned const char *utf16, unsigned char *utf8, unsigned int count) | 219 | unsigned char* utf16decode(const unsigned char *utf16, unsigned char *utf8, |
214 | unsigned char* utf16decode(const unsigned char *utf16, unsigned char *utf8, unsigned int count) | 220 | unsigned int count) |
215 | { | 221 | { |
216 | unsigned long ucs; | 222 | unsigned long ucs; |
217 | 223 | ||
diff --git a/tools/Makefile b/tools/Makefile index a8e8ddcc6c..89c3681cc9 100644 --- a/tools/Makefile +++ b/tools/Makefile | |||
@@ -41,7 +41,7 @@ ipod_fw: ipod_fw.c | |||
41 | convbdf: convbdf.c | 41 | convbdf: convbdf.c |
42 | $(CC) -g $+ -o $@ | 42 | $(CC) -g $+ -o $@ |
43 | 43 | ||
44 | codepages: codepages.c | 44 | codepages: codepages.c codepage_tables.c |
45 | $(CC) -g $+ -o $@ | 45 | $(CC) -g $+ -o $@ |
46 | 46 | ||
47 | generate_rocklatin: generate_rocklatin.c ../firmware/drivers/lcd-player-charset.c | 47 | generate_rocklatin: generate_rocklatin.c ../firmware/drivers/lcd-player-charset.c |
diff --git a/tools/codepages.h b/tools/codepage_tables.c index cfe9a4cca8..45e3d529ab 100644 --- a/tools/codepages.h +++ b/tools/codepage_tables.c | |||
@@ -17,7 +17,41 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | static const unsigned short cp932_table[] = { | 20 | #include "codepage_tables.h" |
21 | |||
22 | const unsigned short iso8859_7_to_uni[] = { | ||
23 | 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, /* A1-A7 */ | ||
24 | 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, /* A8-AF */ | ||
25 | 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7 /* B0-B7 */ | ||
26 | }; | ||
27 | |||
28 | const unsigned short cp1251_to_uni[] = { | ||
29 | 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, /* 80-87 */ | ||
30 | 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, /* 88-8F */ | ||
31 | 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, /* 90-97 */ | ||
32 | 0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, /* 98-9F */ | ||
33 | 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, /* A0-A7 */ | ||
34 | 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, /* A8-AF */ | ||
35 | 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, /* B0-B7 */ | ||
36 | 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457 /* B8-BF */ | ||
37 | }; | ||
38 | |||
39 | const unsigned short iso8859_2_to_uni[] = { | ||
40 | 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, /* A1-A7 */ | ||
41 | 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, /* A8-AF */ | ||
42 | 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, /* B0-B7 */ | ||
43 | 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, /* B8-BF */ | ||
44 | 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, /* C0-C7 */ | ||
45 | 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, /* C8-CF */ | ||
46 | 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, /* D0-D7 */ | ||
47 | 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, /* D8-DF */ | ||
48 | 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, /* E0-E7 */ | ||
49 | 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, /* E8-EF */ | ||
50 | 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, /* F0-F7 */ | ||
51 | 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 /* F8-FF */ | ||
52 | }; | ||
53 | |||
54 | const unsigned short cp932_table[] = { | ||
21 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 55 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
22 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 56 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
23 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 57 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
@@ -4116,8 +4150,7 @@ static const unsigned short cp932_table[] = { | |||
4116 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 4150 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
4117 | }; | 4151 | }; |
4118 | 4152 | ||
4119 | 4153 | const unsigned short cp936_table[] = { | |
4120 | static const unsigned short cp936_table[] = { | ||
4121 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 4154 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
4122 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 4155 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
4123 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 4156 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
@@ -8217,7 +8250,7 @@ static const unsigned short cp936_table[] = { | |||
8217 | }; | 8250 | }; |
8218 | 8251 | ||
8219 | 8252 | ||
8220 | static const unsigned short cp949_table[] = { | 8253 | const unsigned short cp949_table[] = { |
8221 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 8254 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
8222 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 8255 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
8223 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 8256 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
@@ -12317,7 +12350,7 @@ static const unsigned short cp949_table[] = { | |||
12317 | }; | 12350 | }; |
12318 | 12351 | ||
12319 | 12352 | ||
12320 | static const unsigned short cp950_table[] = { | 12353 | const unsigned short cp950_table[] = { |
12321 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 12354 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
12322 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 12355 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
12323 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 12356 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
@@ -16416,4 +16449,3 @@ static const unsigned short cp950_table[] = { | |||
16416 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | 16449 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
16417 | }; | 16450 | }; |
16418 | 16451 | ||
16419 | |||
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; |