2 * Copyright (C) 1999-2006, 2012, 2016 Free Software Foundation, Inc.
3 * This file is part of the GNU LIBICONV Library.
5 * The GNU LIBICONV Library is free software; you can redistribute it
6 * and/or modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either version 2.1
8 * of the License, or (at your option) any later version.
10 * The GNU LIBICONV Library is distributed in the hope that it will be
11 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 * If not, see <https://www.gnu.org/licenses/>.
24 static const unsigned short hkscs2004_2uni_page87
[58] = {
26 0x0af0, 0x1032, 0x0d03, 0x0ca6, 0x0c78, 0x4167, 0x1177, 0x0cb3,
27 0x44b1, 0x10e2, 0x44c5, 0x0595, 0x0e36, 0x0e44, 0x1047, 0x1040,
28 0x39bf, 0x3417, 0x4252, 0x3f8b, 0x40d2, 0x1057, 0x4d51, 0x0e4f,
29 0x0cda, 0x1085, 0x446c, 0x1107, 0x0fa4, 0x0da1, 0x3d23, 0x1e25,
30 0x3c54, 0x2d63, 0x3606, 0x3761, 0x1a4d, 0x13fb, 0x28fd, 0x2195,
31 0x141d, 0x47b9, 0x06f4, 0x2534, 0x43ef, 0x16db, 0x2e5e, 0x15a4,
32 0x0125, 0x4bb0, 0x15d1, 0x16b7, 0x17fc, 0x1b6e, 0x2393, 0x4a45,
35 static const unsigned short hkscs2004_2uni_page8c
[189] = {
37 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
38 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
39 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
40 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
41 0x28fd, 0x28fd, 0x2b6f, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
42 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
43 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
44 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
45 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
46 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
47 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
48 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
49 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
50 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
51 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd, 0x28fd,
52 0x28fd, 0x1ae7, 0x28fd, 0x1c57, 0x20ca, 0x0688, 0x0bc3, 0x3256,
53 0x3196, 0x0a9a, 0x0c36, 0x28fd, 0x17d5, 0x351a, 0x24f9, 0x1778,
54 0x0612, 0x3351, 0x1878, 0x27b2, 0x1d57, 0x0c58, 0x38ec, 0x2f23,
55 0x1077, 0x0478, 0x004a, 0x29a4, 0x3e41, 0x24cc, 0x12b4, 0x2a39,
56 0x14bf, 0x226c, 0x2656, 0x49fa, 0x193b,
58 0x2c9f, 0x28fd, 0x30c1, 0x466d, 0x0902, 0x0dbb, 0x4879, 0x0707,
59 0x27b3, 0x4cb5, 0x08f8, 0x02d6, 0x0df7, 0x3e46, 0x097c, 0x45b2,
60 0x42ff, 0x0c6d, 0x03d4, 0x3b9a, 0x0c61, 0x0c1b, 0x1189, 0x107b,
61 0x1176, 0x0cea, 0x07c8, 0x3a0f, 0x0161, 0x0bde, 0x0bbd, 0x09ed,
64 static const ucs4_t hkscs2004_2uni_upages
[78] = {
65 0x03400, 0x03600, 0x03700, 0x03800, 0x03900, 0x03b00, 0x03d00, 0x03f00,
66 0x04000, 0x04100, 0x04300, 0x04400, 0x04500, 0x04600, 0x04700, 0x04a00,
67 0x04c00, 0x04d00, 0x04f00, 0x05600, 0x05900, 0x05a00, 0x05b00, 0x05c00,
68 0x05d00, 0x05f00, 0x06600, 0x06700, 0x06e00, 0x07100, 0x07200, 0x07400,
69 0x07900, 0x07d00, 0x08100, 0x08500, 0x08a00, 0x09700, 0x09800, 0x09f00,
70 0x0ff00, 0x20100, 0x20200, 0x20a00, 0x20b00, 0x21a00, 0x21d00, 0x21e00,
71 0x22100, 0x22700, 0x23200, 0x23500, 0x23600, 0x23b00, 0x23e00, 0x23f00,
72 0x24000, 0x24200, 0x24b00, 0x25400, 0x25a00, 0x26b00, 0x26c00, 0x26e00,
73 0x27000, 0x27200, 0x27300, 0x27b00, 0x27c00, 0x28600, 0x28900, 0x28b00,
74 0x29000, 0x29800, 0x29900, 0x29e00, 0x2a100, 0x2a300,
78 hkscs2004_mbtowc (conv_t conv
, ucs4_t
*pwc
, const unsigned char *s
, size_t n
)
80 unsigned char c1
= s
[0];
81 if ((c1
== 0x87) || (c1
>= 0x8c && c1
<= 0x8d)) {
83 unsigned char c2
= s
[1];
84 if ((c2
>= 0x40 && c2
< 0x7f) || (c2
>= 0xa1 && c2
< 0xff)) {
85 unsigned int i
= 157 * (c1
- 0x80) + (c2
- (c2
>= 0xa1 ? 0x62 : 0x40));
90 swc
= hkscs2004_2uni_page87
[i
-1099],
91 wc
= hkscs2004_2uni_upages
[swc
>>8] | (swc
& 0xff);
94 swc
= hkscs2004_2uni_page8c
[i
-1884],
95 wc
= hkscs2004_2uni_upages
[swc
>>8] | (swc
& 0xff);
104 return RET_TOOFEW(0);
109 static const unsigned short hkscs2004_2charset
[123] = {
110 0x8cf4, 0x8770, 0x8d5c, 0x8d4b, 0x8d52, 0x8cf3, 0x874b, 0x8cea,
111 0x8cdf, 0x876a, 0x8d47, 0x8d5a, 0x8d4a, 0x8d44, 0x8d4e, 0x8d5f,
112 0x8ce3, 0x8740, 0x8d5e, 0x8ce0, 0x8d5d, 0x8d55, 0x8ce4, 0x8cef,
113 0x8d54, 0x8d51, 0x8744, 0x8743, 0x8747, 0x8758, 0x8d59, 0x8742,
114 0x875d, 0x8d45, 0x8d4c, 0x874c, 0x874d, 0x8757, 0x875c, 0x8741,
115 0x874f, 0x874e, 0x8755, 0x8cf2, 0x8d57, 0x8759, 0x8749, 0x875b,
116 0x8d58, 0x8746, 0x8d56, 0x8cf8, 0x8765, 0x8768, 0x8cfa, 0x876f,
117 0x8772, 0x8773, 0x876d, 0x8ce9, 0x8ce6, 0x8774, 0x8cec, 0x8cfe,
118 0x8764, 0x8cdb, 0x8775, 0x8cdd, 0x8cee, 0x875f, 0x8778, 0x8779,
119 0x8cde, 0x8767, 0x8cfb, 0x8776, 0x8cf7, 0x8ce8, 0x876b, 0x8cfc,
120 0x8ced, 0x8d48, 0x8cf5, 0x8cf9, 0x8c62, 0x8d40, 0x8761, 0x876e,
121 0x8cf1, 0x8d42, 0x8ce2, 0x8ce1, 0x8ceb, 0x8751, 0x8ce7, 0x8762,
122 0x8763, 0x8cf0, 0x8750, 0x8d5b, 0x8d53, 0x8760, 0x875e, 0x8cf6,
123 0x8d4d, 0x8753, 0x8754, 0x8745, 0x8752, 0x8d50, 0x876c, 0x875a,
124 0x8748, 0x874a, 0x8d4f, 0x8d43, 0x8769, 0x8d46, 0x8cfd, 0x8777,
125 0x8771, 0x8d49, 0x8756,
128 static const Summary16 hkscs2004_uni2indx_page34
[5] = {
130 { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 },
133 static const Summary16 hkscs2004_uni2indx_page36
[56] = {
135 { 1, 0x0000 }, { 1, 0x0000 }, { 1, 0x0020 }, { 2, 0x0000 },
136 { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0002 }, { 3, 0x0000 },
137 { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
138 { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
140 { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
141 { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
142 { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
143 { 3, 0x0000 }, { 3, 0x0040 }, { 4, 0x0000 }, { 4, 0x0000 },
145 { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 },
146 { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 },
147 { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 }, { 4, 0x0000 },
148 { 4, 0x0000 }, { 4, 0x0010 }, { 5, 0x0000 }, { 5, 0x0000 },
150 { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 },
151 { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0100 },
153 static const Summary16 hkscs2004_uni2indx_page3b
[10] = {
155 { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 },
156 { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 },
157 { 6, 0x0000 }, { 6, 0x0020 },
159 static const Summary16 hkscs2004_uni2indx_page3d
[16] = {
161 { 7, 0x0000 }, { 7, 0x0004 }, { 8, 0x0000 }, { 8, 0x0000 },
162 { 8, 0x0000 }, { 8, 0x0000 }, { 8, 0x0000 }, { 8, 0x0000 },
163 { 8, 0x0100 }, { 9, 0x0000 }, { 9, 0x0000 }, { 9, 0x0000 },
164 { 9, 0x0000 }, { 9, 0x0000 }, { 9, 0x0000 }, { 9, 0x0010 },
166 static const Summary16 hkscs2004_uni2indx_page3f
[47] = {
168 { 10, 0x0080 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
169 { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
170 { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
171 { 11, 0x0100 }, { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 },
173 { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 },
174 { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 },
175 { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 },
176 { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x0100 },
178 { 13, 0x0004 }, { 14, 0x0000 }, { 14, 0x0000 }, { 14, 0x0000 },
179 { 14, 0x0000 }, { 14, 0x0000 }, { 14, 0x0000 }, { 14, 0x1000 },
180 { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 },
181 { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x2000 },
183 static const Summary16 hkscs2004_uni2indx_page43
[69] = {
185 { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0000 },
186 { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0000 },
187 { 16, 0x0000 }, { 16, 0x0400 }, { 17, 0x0000 }, { 17, 0x0000 },
188 { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x0001 },
190 { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 },
191 { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 },
192 { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x2000 },
193 { 19, 0x0008 }, { 20, 0x4000 }, { 21, 0x0000 }, { 21, 0x0000 },
195 { 21, 0x0000 }, { 21, 0x0800 }, { 22, 0x0000 }, { 22, 0x0040 },
196 { 23, 0x0000 }, { 23, 0x0100 }, { 24, 0x2002 }, { 26, 0x0100 },
197 { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0040 }, { 28, 0x0008 },
198 { 29, 0x0000 }, { 29, 0x0400 }, { 30, 0x0400 }, { 31, 0x0000 },
200 { 31, 0x0008 }, { 32, 0x0000 }, { 32, 0x0000 }, { 32, 0x0000 },
201 { 32, 0x0000 }, { 32, 0x0000 }, { 32, 0x0000 }, { 32, 0x0000 },
202 { 32, 0x0000 }, { 32, 0x0000 }, { 32, 0x0002 }, { 33, 0x0800 },
203 { 34, 0x0000 }, { 34, 0x0000 }, { 34, 0x0000 }, { 34, 0x0080 },
205 { 35, 0x0000 }, { 35, 0x0000 }, { 35, 0x0000 }, { 35, 0x0040 },
208 static const Summary16 hkscs2004_uni2indx_page4a
[11] = {
210 { 38, 0x0000 }, { 38, 0x0000 }, { 38, 0x0000 }, { 38, 0x0000 },
211 { 38, 0x0000 }, { 38, 0x0000 }, { 38, 0x0000 }, { 38, 0x0000 },
212 { 38, 0x0000 }, { 38, 0x0000 }, { 38, 0x0010 },
214 static const Summary16 hkscs2004_uni2indx_page4c
[25] = {
216 { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0004 },
217 { 40, 0x0081 }, { 42, 0x0080 }, { 43, 0x0000 }, { 43, 0x0880 },
218 { 45, 0x0020 }, { 46, 0x0000 }, { 46, 0x0000 }, { 46, 0x0000 },
219 { 46, 0x0000 }, { 46, 0x0000 }, { 46, 0x0004 }, { 47, 0x0000 },
221 { 47, 0x0080 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 },
222 { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x00c0 },
225 static const Summary16 hkscs2004_uni2indx_page4f
[12] = {
227 { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 },
228 { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 },
229 { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0010 },
231 static const Summary16 hkscs2004_uni2indx_page56
[16] = {
233 { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 },
234 { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 },
235 { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 },
236 { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0800 },
238 static const Summary16 hkscs2004_uni2indx_page59
[72] = {
240 { 53, 0x0000 }, { 53, 0x2000 }, { 54, 0x0000 }, { 54, 0x0000 },
241 { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 },
242 { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x8000 },
243 { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
245 { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
246 { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
247 { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0010 }, { 56, 0x0000 },
248 { 56, 0x0000 }, { 56, 0x0002 }, { 57, 0x0000 }, { 57, 0x0000 },
250 { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 },
251 { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 },
252 { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0080 },
253 { 58, 0x0000 }, { 58, 0x0800 }, { 59, 0x0000 }, { 59, 0x0000 },
255 { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 },
256 { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0100 },
257 { 60, 0x0000 }, { 60, 0x0000 }, { 60, 0x0000 }, { 60, 0x0000 },
258 { 60, 0x0000 }, { 60, 0x0020 }, { 61, 0x0000 }, { 61, 0x1000 },
260 { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 },
261 { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0100 },
263 static const Summary16 hkscs2004_uni2indx_page5f
[4] = {
265 { 63, 0x0000 }, { 63, 0x0000 }, { 63, 0x0000 }, { 63, 0x0800 },
267 static const Summary16 hkscs2004_uni2indx_page66
[23] = {
269 { 64, 0x0000 }, { 64, 0x0000 }, { 64, 0x0000 }, { 64, 0x0000 },
270 { 64, 0x2000 }, { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 },
271 { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 },
272 { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0080 }, { 66, 0x0000 },
274 { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x0000 },
275 { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x4000 },
277 static const Summary16 hkscs2004_uni2indx_page6e
[6] = {
279 { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 },
280 { 67, 0x0000 }, { 67, 0x0080 },
282 static const Summary16 hkscs2004_uni2indx_page71
[19] = {
284 { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 },
285 { 68, 0x0000 }, { 68, 0x0080 }, { 69, 0x0000 }, { 69, 0x0000 },
286 { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 },
287 { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 },
289 { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0020 },
291 static const Summary16 hkscs2004_uni2indx_page74
[10] = {
293 { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0000 },
294 { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0002 }, { 71, 0x0000 },
295 { 71, 0x0000 }, { 71, 0x2000 },
297 static const Summary16 hkscs2004_uni2indx_page79
[13] = {
299 { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 },
300 { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 },
301 { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0000 },
304 static const Summary16 hkscs2004_uni2indx_page7d
[10] = {
306 { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
307 { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
308 { 73, 0x0000 }, { 73, 0x0020 },
310 static const Summary16 hkscs2004_uni2indx_page81
[7] = {
312 { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 },
313 { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x1000 },
315 static const Summary16 hkscs2004_uni2indx_page85
[10] = {
317 { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
318 { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
319 { 75, 0x0000 }, { 75, 0x0008 },
321 static const Summary16 hkscs2004_uni2indx_page8a
[16] = {
323 { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
324 { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
325 { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
326 { 76, 0x1000 }, { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0x0200 },
328 static const Summary16 hkscs2004_uni2indx_page97
[22] = {
330 { 78, 0x0000 }, { 78, 0x0000 }, { 78, 0x0000 }, { 78, 0x0010 },
331 { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 },
332 { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 },
333 { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 },
335 { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 },
336 { 79, 0x0000 }, { 79, 0x0040 },
338 static const Summary16 hkscs2004_uni2indx_page9f
[12] = {
340 { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x0000 },
341 { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x0000 },
342 { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x0000 }, { 80, 0x000c },
344 static const Summary16 hkscs2004_uni2indx_page201
[20] = {
346 { 82, 0x0000 }, { 82, 0x0000 }, { 82, 0x0000 }, { 82, 0x0000 },
347 { 82, 0x0000 }, { 82, 0x0000 }, { 82, 0x0000 }, { 82, 0x0000 },
348 { 82, 0x0000 }, { 82, 0x0000 }, { 82, 0x0010 }, { 83, 0x0000 },
349 { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0000 },
351 { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0200 },
353 static const Summary16 hkscs2004_uni2indx_page20a
[26] = {
355 { 84, 0x0000 }, { 84, 0x0000 }, { 84, 0x0000 }, { 84, 0x0000 },
356 { 84, 0x0000 }, { 84, 0x0000 }, { 84, 0x8000 }, { 85, 0x0000 },
357 { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
358 { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
360 { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
361 { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
362 { 85, 0x0000 }, { 85, 0x8000 },
364 static const Summary16 hkscs2004_uni2indx_page21a
[7] = {
366 { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0000 },
367 { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0008 },
369 static const Summary16 hkscs2004_uni2indx_page21d
[19] = {
371 { 87, 0x0000 }, { 87, 0x0000 }, { 87, 0x0000 }, { 87, 0x0000 },
372 { 87, 0x0000 }, { 87, 0x4000 }, { 88, 0x0000 }, { 88, 0x0000 },
373 { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 },
374 { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 },
376 { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0008 },
378 static const Summary16 hkscs2004_uni2indx_page221
[13] = {
380 { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 },
381 { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 },
382 { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 },
385 static const Summary16 hkscs2004_uni2indx_page227
[10] = {
387 { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 },
388 { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 },
389 { 90, 0x0000 }, { 90, 0x0040 },
391 static const Summary16 hkscs2004_uni2indx_page232
[6] = {
393 { 91, 0x0000 }, { 91, 0x0000 }, { 91, 0x0000 }, { 91, 0x0000 },
394 { 91, 0x0000 }, { 91, 0x0040 },
396 static const Summary16 hkscs2004_uni2indx_page235
[18] = {
398 { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 },
399 { 92, 0x0000 }, { 92, 0x0002 }, { 93, 0x0000 }, { 93, 0x0000 },
400 { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
401 { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
403 { 93, 0x0000 }, { 93, 0x0080 },
405 static const Summary16 hkscs2004_uni2indx_page23b
[2] = {
407 { 94, 0x0000 }, { 94, 0x0400 },
409 static const Summary16 hkscs2004_uni2indx_page23e
[47] = {
411 { 95, 0x0040 }, { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 },
412 { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 },
413 { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 },
414 { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 },
416 { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0000 },
417 { 96, 0x0000 }, { 96, 0x0000 }, { 96, 0x0002 }, { 97, 0x0000 },
418 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
419 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
421 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
422 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
423 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
424 { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x1000 },
426 static const Summary16 hkscs2004_uni2indx_page242
[12] = {
428 { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 },
429 { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 },
430 { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x8000 },
432 static const Summary16 hkscs2004_uni2indx_page24b
[1] = {
436 static const Summary16 hkscs2004_uni2indx_page254
[10] = {
438 { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
439 { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
440 { 100, 0x0000 }, { 100, 0x0400 },
442 static const Summary16 hkscs2004_uni2indx_page25a
[6] = {
444 { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 },
445 { 101, 0x0000 }, { 101, 0x0010 },
447 static const Summary16 hkscs2004_uni2indx_page26b
[21] = {
449 { 102, 0x0000 }, { 102, 0x0000 }, { 102, 0x0008 }, { 103, 0x0000 },
450 { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 },
451 { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 },
452 { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 },
454 { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 },
457 static const Summary16 hkscs2004_uni2indx_page26e
[9] = {
459 { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
460 { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
463 static const Summary16 hkscs2004_uni2indx_page270
[14] = {
465 { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 },
466 { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 },
467 { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 }, { 106, 0x0000 },
468 { 106, 0x0000 }, { 106, 0x0004 },
470 static const Summary16 hkscs2004_uni2indx_page272
[32] = {
472 { 107, 0x0000 }, { 107, 0x0000 }, { 107, 0x0000 }, { 107, 0x0000 },
473 { 107, 0x0000 }, { 107, 0x0000 }, { 107, 0x0080 }, { 108, 0x0000 },
474 { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
475 { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
477 { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
478 { 108, 0x0000 }, { 108, 0x0004 }, { 109, 0x0000 }, { 109, 0x0000 },
479 { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x0000 },
480 { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x8000 },
482 static const Summary16 hkscs2004_uni2indx_page27b
[29] = {
484 { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 },
485 { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 },
486 { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 },
487 { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x8000 }, { 111, 0x0000 },
489 { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 },
490 { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x1000 }, { 112, 0x0000 },
491 { 112, 0x0000 }, { 112, 0x0000 }, { 112, 0x0000 }, { 112, 0x0002 },
494 static const Summary16 hkscs2004_uni2indx_page286
[12] = {
496 { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0000 },
497 { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0000 },
498 { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0000 }, { 114, 0x0004 },
500 static const Summary16 hkscs2004_uni2indx_page289
[7] = {
502 { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
503 { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x2000 },
505 static const Summary16 hkscs2004_uni2indx_page28b
[12] = {
507 { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0000 },
508 { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0000 },
509 { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0000 }, { 116, 0x0200 },
511 static const Summary16 hkscs2004_uni2indx_page290
[8] = {
513 { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 },
514 { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0200 },
516 static const Summary16 hkscs2004_uni2indx_page298
[21] = {
518 { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 },
519 { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 },
520 { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 },
521 { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0000 }, { 118, 0x0400 },
523 { 119, 0x0000 }, { 119, 0x0000 }, { 119, 0x0000 }, { 119, 0x0000 },
526 static const Summary16 hkscs2004_uni2indx_page29e
[12] = {
528 { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0000 },
529 { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0000 },
530 { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0000 }, { 120, 0x0001 },
532 static const Summary16 hkscs2004_uni2indx_page2a1
[12] = {
534 { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0000 },
535 { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0000 },
536 { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0000 }, { 121, 0x0020 },
538 static const Summary16 hkscs2004_uni2indx_page2a3
[6] = {
540 { 122, 0x0000 }, { 122, 0x0000 }, { 122, 0x0000 }, { 122, 0x0000 },
541 { 122, 0x0000 }, { 122, 0x0002 },
545 hkscs2004_wctomb (conv_t conv
, unsigned char *r
, ucs4_t wc
, size_t n
)
548 const Summary16
*summary
= NULL
;
551 if (wc
>= 0x3400 && wc
< 0x3450)
552 summary
= &hkscs2004_uni2indx_page34
[(wc
>>4)-0x340];
553 else if (wc
>= 0x3600 && wc
< 0x3980)
554 summary
= &hkscs2004_uni2indx_page36
[(wc
>>4)-0x360];
555 else if (wc
>= 0x3b00 && wc
< 0x3ba0)
556 summary
= &hkscs2004_uni2indx_page3b
[(wc
>>4)-0x3b0];
557 else if (wc
>= 0x3d00 && wc
< 0x3e00)
558 summary
= &hkscs2004_uni2indx_page3d
[(wc
>>4)-0x3d0];
559 else if (wc
>= 0x3f00 && wc
< 0x41f0)
560 summary
= &hkscs2004_uni2indx_page3f
[(wc
>>4)-0x3f0];
561 else if (wc
>= 0x4300 && wc
< 0x4750)
562 summary
= &hkscs2004_uni2indx_page43
[(wc
>>4)-0x430];
563 else if (wc
>= 0x4a00 && wc
< 0x4ab0)
564 summary
= &hkscs2004_uni2indx_page4a
[(wc
>>4)-0x4a0];
565 else if (wc
>= 0x4c00 && wc
< 0x4d90)
566 summary
= &hkscs2004_uni2indx_page4c
[(wc
>>4)-0x4c0];
567 else if (wc
>= 0x4f00 && wc
< 0x4fc0)
568 summary
= &hkscs2004_uni2indx_page4f
[(wc
>>4)-0x4f0];
569 else if (wc
>= 0x5600 && wc
< 0x5700)
570 summary
= &hkscs2004_uni2indx_page56
[(wc
>>4)-0x560];
571 else if (wc
>= 0x5900 && wc
< 0x5d80)
572 summary
= &hkscs2004_uni2indx_page59
[(wc
>>4)-0x590];
573 else if (wc
>= 0x5f00 && wc
< 0x5f40)
574 summary
= &hkscs2004_uni2indx_page5f
[(wc
>>4)-0x5f0];
575 else if (wc
>= 0x6600 && wc
< 0x6770)
576 summary
= &hkscs2004_uni2indx_page66
[(wc
>>4)-0x660];
578 if (wc
>= 0x6e00 && wc
< 0x6e60)
579 summary
= &hkscs2004_uni2indx_page6e
[(wc
>>4)-0x6e0];
580 else if (wc
>= 0x7100 && wc
< 0x7230)
581 summary
= &hkscs2004_uni2indx_page71
[(wc
>>4)-0x710];
582 else if (wc
>= 0x7400 && wc
< 0x74a0)
583 summary
= &hkscs2004_uni2indx_page74
[(wc
>>4)-0x740];
584 else if (wc
>= 0x7900 && wc
< 0x79d0)
585 summary
= &hkscs2004_uni2indx_page79
[(wc
>>4)-0x790];
586 else if (wc
>= 0x7d00 && wc
< 0x7da0)
587 summary
= &hkscs2004_uni2indx_page7d
[(wc
>>4)-0x7d0];
588 else if (wc
>= 0x8100 && wc
< 0x8170)
589 summary
= &hkscs2004_uni2indx_page81
[(wc
>>4)-0x810];
590 else if (wc
>= 0x8500 && wc
< 0x85a0)
591 summary
= &hkscs2004_uni2indx_page85
[(wc
>>4)-0x850];
592 else if (wc
>= 0x8a00 && wc
< 0x8b00)
593 summary
= &hkscs2004_uni2indx_page8a
[(wc
>>4)-0x8a0];
594 else if (wc
>= 0x9700 && wc
< 0x9860)
595 summary
= &hkscs2004_uni2indx_page97
[(wc
>>4)-0x970];
596 else if (wc
>= 0x9f00 && wc
< 0x9fc0)
597 summary
= &hkscs2004_uni2indx_page9f
[(wc
>>4)-0x9f0];
598 else if (wc
>= 0x20100 && wc
< 0x20240)
599 summary
= &hkscs2004_uni2indx_page201
[(wc
>>4)-0x2010];
600 else if (wc
>= 0x20a00 && wc
< 0x20ba0)
601 summary
= &hkscs2004_uni2indx_page20a
[(wc
>>4)-0x20a0];
605 if (wc
>= 0x21a00 && wc
< 0x21a70)
606 summary
= &hkscs2004_uni2indx_page21a
[(wc
>>4)-0x21a0];
607 else if (wc
>= 0x21d00 && wc
< 0x21e30)
608 summary
= &hkscs2004_uni2indx_page21d
[(wc
>>4)-0x21d0];
609 else if (wc
>= 0x22100 && wc
< 0x221d0)
610 summary
= &hkscs2004_uni2indx_page221
[(wc
>>4)-0x2210];
611 else if (wc
>= 0x22700 && wc
< 0x227a0)
612 summary
= &hkscs2004_uni2indx_page227
[(wc
>>4)-0x2270];
613 else if (wc
>= 0x23200 && wc
< 0x23260)
614 summary
= &hkscs2004_uni2indx_page232
[(wc
>>4)-0x2320];
615 else if (wc
>= 0x23500 && wc
< 0x23620)
616 summary
= &hkscs2004_uni2indx_page235
[(wc
>>4)-0x2350];
617 else if (wc
>= 0x23b00 && wc
< 0x23b20)
618 summary
= &hkscs2004_uni2indx_page23b
[(wc
>>4)-0x23b0];
619 else if (wc
>= 0x23e00 && wc
< 0x240f0)
620 summary
= &hkscs2004_uni2indx_page23e
[(wc
>>4)-0x23e0];
621 else if (wc
>= 0x24200 && wc
< 0x242c0)
622 summary
= &hkscs2004_uni2indx_page242
[(wc
>>4)-0x2420];
623 else if (wc
>= 0x24b00 && wc
< 0x24b10)
624 summary
= &hkscs2004_uni2indx_page24b
[(wc
>>4)-0x24b0];
625 else if (wc
>= 0x25400 && wc
< 0x254a0)
626 summary
= &hkscs2004_uni2indx_page254
[(wc
>>4)-0x2540];
627 else if (wc
>= 0x25a00 && wc
< 0x25a60)
628 summary
= &hkscs2004_uni2indx_page25a
[(wc
>>4)-0x25a0];
630 if (wc
>= 0x26b00 && wc
< 0x26c50)
631 summary
= &hkscs2004_uni2indx_page26b
[(wc
>>4)-0x26b0];
632 else if (wc
>= 0x26e00 && wc
< 0x26e90)
633 summary
= &hkscs2004_uni2indx_page26e
[(wc
>>4)-0x26e0];
634 else if (wc
>= 0x27000 && wc
< 0x270e0)
635 summary
= &hkscs2004_uni2indx_page270
[(wc
>>4)-0x2700];
636 else if (wc
>= 0x27200 && wc
< 0x27400)
637 summary
= &hkscs2004_uni2indx_page272
[(wc
>>4)-0x2720];
638 else if (wc
>= 0x27b00 && wc
< 0x27cd0)
639 summary
= &hkscs2004_uni2indx_page27b
[(wc
>>4)-0x27b0];
640 else if (wc
>= 0x28600 && wc
< 0x286c0)
641 summary
= &hkscs2004_uni2indx_page286
[(wc
>>4)-0x2860];
642 else if (wc
>= 0x28900 && wc
< 0x28970)
643 summary
= &hkscs2004_uni2indx_page289
[(wc
>>4)-0x2890];
644 else if (wc
>= 0x28b00 && wc
< 0x28bc0)
645 summary
= &hkscs2004_uni2indx_page28b
[(wc
>>4)-0x28b0];
646 else if (wc
>= 0x29000 && wc
< 0x29080)
647 summary
= &hkscs2004_uni2indx_page290
[(wc
>>4)-0x2900];
648 else if (wc
>= 0x29800 && wc
< 0x29950)
649 summary
= &hkscs2004_uni2indx_page298
[(wc
>>4)-0x2980];
650 else if (wc
>= 0x29e00 && wc
< 0x29ec0)
651 summary
= &hkscs2004_uni2indx_page29e
[(wc
>>4)-0x29e0];
652 else if (wc
>= 0x2a100 && wc
< 0x2a1c0)
653 summary
= &hkscs2004_uni2indx_page2a1
[(wc
>>4)-0x2a10];
654 else if (wc
>= 0x2a300 && wc
< 0x2a360)
655 summary
= &hkscs2004_uni2indx_page2a3
[(wc
>>4)-0x2a30];
659 unsigned short used
= summary
->used
;
660 unsigned int i
= wc
& 0x0f;
661 if (used
& ((unsigned short) 1 << i
)) {
663 /* Keep in 'used' only the bits 0..i-1. */
664 used
&= ((unsigned short) 1 << i
) - 1;
665 /* Add 'summary->indx' and the number of bits set in 'used'. */
666 used
= (used
& 0x5555) + ((used
& 0xaaaa) >> 1);
667 used
= (used
& 0x3333) + ((used
& 0xcccc) >> 2);
668 used
= (used
& 0x0f0f) + ((used
& 0xf0f0) >> 4);
669 used
= (used
& 0x00ff) + (used
>> 8);
670 c
= hkscs2004_2charset
[summary
->indx
+ used
];
671 r
[0] = (c
>> 8); r
[1] = (c
& 0xff);