Annotation of embedaddon/libiconv/lib/hkscs2004.h, revision 1.1.1.2
1.1 misho 1: /*
1.1.1.2 ! misho 2: * Copyright (C) 1999-2006, 2012, 2016 Free Software Foundation, Inc.
1.1 misho 3: * This file is part of the GNU LIBICONV Library.
4: *
5: * The GNU LIBICONV Library is free software; you can redistribute it
6: * and/or modify it under the terms of the GNU Library General Public
7: * License as published by the Free Software Foundation; either version 2
8: * of the License, or (at your option) any later version.
9: *
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: * Library General Public License for more details.
14: *
15: * You should have received a copy of the GNU Library General Public
16: * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
1.1.1.2 ! misho 17: * If not, see <https://www.gnu.org/licenses/>.
1.1 misho 18: */
19:
20: /*
21: * HKSCS:2004
22: */
23:
24: static const unsigned short hkscs2004_2uni_page87[58] = {
25: /* 0x87 */
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,
33: 0x1f61, 0x1f9d,
34: };
35: static const unsigned short hkscs2004_2uni_page8c[189] = {
36: /* 0x8c */
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,
57: /* 0x8d */
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,
62: };
63:
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,
75: };
76:
77: static int
1.1.1.2 ! misho 78: hkscs2004_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
1.1 misho 79: {
80: unsigned char c1 = s[0];
81: if ((c1 == 0x87) || (c1 >= 0x8c && c1 <= 0x8d)) {
82: if (n >= 2) {
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));
86: ucs4_t wc = 0xfffd;
87: unsigned short swc;
88: if (i < 1884) {
89: if (i < 1157)
90: swc = hkscs2004_2uni_page87[i-1099],
91: wc = hkscs2004_2uni_upages[swc>>8] | (swc & 0xff);
92: } else {
93: if (i < 2073)
94: swc = hkscs2004_2uni_page8c[i-1884],
95: wc = hkscs2004_2uni_upages[swc>>8] | (swc & 0xff);
96: }
97: if (wc != 0xfffd) {
98: *pwc = wc;
99: return 2;
100: }
101: }
102: return RET_ILSEQ;
103: }
104: return RET_TOOFEW(0);
105: }
106: return RET_ILSEQ;
107: }
108:
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,
126: };
127:
128: static const Summary16 hkscs2004_uni2indx_page34[5] = {
129: /* 0x3400 */
130: { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 },
131: { 0, 0x0400 },
132: };
133: static const Summary16 hkscs2004_uni2indx_page36[56] = {
134: /* 0x3600 */
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 },
139: /* 0x3700 */
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 },
144: /* 0x3800 */
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 },
149: /* 0x3900 */
150: { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 },
151: { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0100 },
152: };
153: static const Summary16 hkscs2004_uni2indx_page3b[10] = {
154: /* 0x3b00 */
155: { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 },
156: { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0000 },
157: { 6, 0x0000 }, { 6, 0x0020 },
158: };
159: static const Summary16 hkscs2004_uni2indx_page3d[16] = {
160: /* 0x3d00 */
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 },
165: };
166: static const Summary16 hkscs2004_uni2indx_page3f[47] = {
167: /* 0x3f00 */
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 },
172: /* 0x4000 */
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 },
177: /* 0x4100 */
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 },
182: };
183: static const Summary16 hkscs2004_uni2indx_page43[69] = {
184: /* 0x4300 */
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 },
189: /* 0x4400 */
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 },
194: /* 0x4500 */
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 },
199: /* 0x4600 */
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 },
204: /* 0x4700 */
205: { 35, 0x0000 }, { 35, 0x0000 }, { 35, 0x0000 }, { 35, 0x0040 },
206: { 36, 0x8010 },
207: };
208: static const Summary16 hkscs2004_uni2indx_page4a[11] = {
209: /* 0x4a00 */
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 },
213: };
214: static const Summary16 hkscs2004_uni2indx_page4c[25] = {
215: /* 0x4c00 */
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 },
220: /* 0x4d00 */
221: { 47, 0x0080 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 },
222: { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x00c0 },
223: { 50, 0x0200 },
224: };
225: static const Summary16 hkscs2004_uni2indx_page4f[12] = {
226: /* 0x4f00 */
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 },
230: };
231: static const Summary16 hkscs2004_uni2indx_page56[16] = {
232: /* 0x5600 */
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 },
237: };
238: static const Summary16 hkscs2004_uni2indx_page59[72] = {
239: /* 0x5900 */
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 },
244: /* 0x5a00 */
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 },
249: /* 0x5b00 */
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 },
254: /* 0x5c00 */
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 },
259: /* 0x5d00 */
260: { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 },
261: { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0000 }, { 62, 0x0100 },
262: };
263: static const Summary16 hkscs2004_uni2indx_page5f[4] = {
264: /* 0x5f00 */
265: { 63, 0x0000 }, { 63, 0x0000 }, { 63, 0x0000 }, { 63, 0x0800 },
266: };
267: static const Summary16 hkscs2004_uni2indx_page66[23] = {
268: /* 0x6600 */
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 },
273: /* 0x6700 */
274: { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x0000 },
275: { 66, 0x0000 }, { 66, 0x0000 }, { 66, 0x4000 },
276: };
277: static const Summary16 hkscs2004_uni2indx_page6e[6] = {
278: /* 0x6e00 */
279: { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 },
280: { 67, 0x0000 }, { 67, 0x0080 },
281: };
282: static const Summary16 hkscs2004_uni2indx_page71[19] = {
283: /* 0x7100 */
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 },
288: /* 0x7200 */
289: { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0020 },
290: };
291: static const Summary16 hkscs2004_uni2indx_page74[10] = {
292: /* 0x7400 */
293: { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0000 },
294: { 70, 0x0000 }, { 70, 0x0000 }, { 70, 0x0002 }, { 71, 0x0000 },
295: { 71, 0x0000 }, { 71, 0x2000 },
296: };
297: static const Summary16 hkscs2004_uni2indx_page79[13] = {
298: /* 0x7900 */
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 },
302: { 72, 0x0400 },
303: };
304: static const Summary16 hkscs2004_uni2indx_page7d[10] = {
305: /* 0x7d00 */
306: { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
307: { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
308: { 73, 0x0000 }, { 73, 0x0020 },
309: };
310: static const Summary16 hkscs2004_uni2indx_page81[7] = {
311: /* 0x8100 */
312: { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 },
313: { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x1000 },
314: };
315: static const Summary16 hkscs2004_uni2indx_page85[10] = {
316: /* 0x8500 */
317: { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
318: { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
319: { 75, 0x0000 }, { 75, 0x0008 },
320: };
321: static const Summary16 hkscs2004_uni2indx_page8a[16] = {
322: /* 0x8a00 */
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 },
327: };
328: static const Summary16 hkscs2004_uni2indx_page97[22] = {
329: /* 0x9700 */
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 },
334: /* 0x9800 */
335: { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 }, { 79, 0x0000 },
336: { 79, 0x0000 }, { 79, 0x0040 },
337: };
338: static const Summary16 hkscs2004_uni2indx_page9f[12] = {
339: /* 0x9f00 */
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 },
343: };
344: static const Summary16 hkscs2004_uni2indx_page201[20] = {
345: /* 0x20100 */
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 },
350: /* 0x20200 */
351: { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0000 }, { 83, 0x0200 },
352: };
353: static const Summary16 hkscs2004_uni2indx_page20a[26] = {
354: /* 0x20a00 */
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 },
359: /* 0x20b00 */
360: { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
361: { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 }, { 85, 0x0000 },
362: { 85, 0x0000 }, { 85, 0x8000 },
363: };
364: static const Summary16 hkscs2004_uni2indx_page21a[7] = {
365: /* 0x21a00 */
366: { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0000 },
367: { 86, 0x0000 }, { 86, 0x0000 }, { 86, 0x0008 },
368: };
369: static const Summary16 hkscs2004_uni2indx_page21d[19] = {
370: /* 0x21d00 */
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 },
375: /* 0x21e00 */
376: { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0008 },
377: };
378: static const Summary16 hkscs2004_uni2indx_page221[13] = {
379: /* 0x22100 */
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 },
383: { 89, 0x0002 },
384: };
385: static const Summary16 hkscs2004_uni2indx_page227[10] = {
386: /* 0x22700 */
387: { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 },
388: { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 },
389: { 90, 0x0000 }, { 90, 0x0040 },
390: };
391: static const Summary16 hkscs2004_uni2indx_page232[6] = {
392: /* 0x23200 */
393: { 91, 0x0000 }, { 91, 0x0000 }, { 91, 0x0000 }, { 91, 0x0000 },
394: { 91, 0x0000 }, { 91, 0x0040 },
395: };
396: static const Summary16 hkscs2004_uni2indx_page235[18] = {
397: /* 0x23500 */
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 },
402: /* 0x23600 */
403: { 93, 0x0000 }, { 93, 0x0080 },
404: };
405: static const Summary16 hkscs2004_uni2indx_page23b[2] = {
406: /* 0x23b00 */
407: { 94, 0x0000 }, { 94, 0x0400 },
408: };
409: static const Summary16 hkscs2004_uni2indx_page23e[47] = {
410: /* 0x23e00 */
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 },
415: /* 0x23f00 */
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 },
420: /* 0x24000 */
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 },
425: };
426: static const Summary16 hkscs2004_uni2indx_page242[12] = {
427: /* 0x24200 */
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 },
431: };
432: static const Summary16 hkscs2004_uni2indx_page24b[1] = {
433: /* 0x24b00 */
434: { 99, 0x8000 },
435: };
436: static const Summary16 hkscs2004_uni2indx_page254[10] = {
437: /* 0x25400 */
438: { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
439: { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
440: { 100, 0x0000 }, { 100, 0x0400 },
441: };
442: static const Summary16 hkscs2004_uni2indx_page25a[6] = {
443: /* 0x25a00 */
444: { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 },
445: { 101, 0x0000 }, { 101, 0x0010 },
446: };
447: static const Summary16 hkscs2004_uni2indx_page26b[21] = {
448: /* 0x26b00 */
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 },
453: /* 0x26c00 */
454: { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 }, { 103, 0x0000 },
455: { 103, 0x0042 },
456: };
457: static const Summary16 hkscs2004_uni2indx_page26e[9] = {
458: /* 0x26e00 */
459: { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
460: { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
461: { 105, 0x0800 },
462: };
463: static const Summary16 hkscs2004_uni2indx_page270[14] = {
464: /* 0x27000 */
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 },
469: };
470: static const Summary16 hkscs2004_uni2indx_page272[32] = {
471: /* 0x27200 */
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 },
476: /* 0x27300 */
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 },
481: };
482: static const Summary16 hkscs2004_uni2indx_page27b[29] = {
483: /* 0x27b00 */
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 },
488: /* 0x27c00 */
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 },
492: { 113, 0x0020 },
493: };
494: static const Summary16 hkscs2004_uni2indx_page286[12] = {
495: /* 0x28600 */
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 },
499: };
500: static const Summary16 hkscs2004_uni2indx_page289[7] = {
501: /* 0x28900 */
502: { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
503: { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x2000 },
504: };
505: static const Summary16 hkscs2004_uni2indx_page28b[12] = {
506: /* 0x28b00 */
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 },
510: };
511: static const Summary16 hkscs2004_uni2indx_page290[8] = {
512: /* 0x29000 */
513: { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 },
514: { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0000 }, { 117, 0x0200 },
515: };
516: static const Summary16 hkscs2004_uni2indx_page298[21] = {
517: /* 0x29800 */
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 },
522: /* 0x29900 */
523: { 119, 0x0000 }, { 119, 0x0000 }, { 119, 0x0000 }, { 119, 0x0000 },
524: { 119, 0x0020 },
525: };
526: static const Summary16 hkscs2004_uni2indx_page29e[12] = {
527: /* 0x29e00 */
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 },
531: };
532: static const Summary16 hkscs2004_uni2indx_page2a1[12] = {
533: /* 0x2a100 */
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 },
537: };
538: static const Summary16 hkscs2004_uni2indx_page2a3[6] = {
539: /* 0x2a300 */
540: { 122, 0x0000 }, { 122, 0x0000 }, { 122, 0x0000 }, { 122, 0x0000 },
541: { 122, 0x0000 }, { 122, 0x0002 },
542: };
543:
544: static int
1.1.1.2 ! misho 545: hkscs2004_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
1.1 misho 546: {
547: if (n >= 2) {
548: const Summary16 *summary = NULL;
549: if (wc < 0x21a00) {
550: if (wc < 0x6e00) {
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];
577: } else {
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];
602: }
603: } else {
604: if (wc < 0x26b00) {
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];
629: } else {
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];
656: }
657: }
658: if (summary) {
659: unsigned short used = summary->used;
660: unsigned int i = wc & 0x0f;
661: if (used & ((unsigned short) 1 << i)) {
662: unsigned short c;
1.1.1.2 ! misho 663: /* Keep in 'used' only the bits 0..i-1. */
1.1 misho 664: used &= ((unsigned short) 1 << i) - 1;
1.1.1.2 ! misho 665: /* Add 'summary->indx' and the number of bits set in 'used'. */
1.1 misho 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);
672: return 2;
673: }
674: }
675: return RET_ILUNI;
676: }
677: return RET_TOOSMALL;
678: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>