hkscs2004.h 32 KB

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