hkscs2001.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. /*
  2. * Copyright (C) 1999-2006, 2012, 2016 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 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.
  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. * Lesser General Public License for more details.
  14. *
  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/>.
  18. */
  19. /*
  20. * HKSCS:2001
  21. */
  22. static const unsigned short hkscs2001_2uni_page8c[123] = {
  23. /* 0x8c */
  24. 0x0a3b, 0x1cfe, 0x5273, 0x37a6, 0x02c9, 0x2d8f, 0x414e, 0x1d77,
  25. 0x12f5, 0x0620, 0x45cd, 0x0059, 0x4830, 0x1622, 0x4f32, 0x30a7,
  26. 0x31f6, 0x1e91, 0x1819, 0x20ba, 0x3e81, 0x5307, 0x018b, 0x3a80,
  27. 0x0610, 0x24e4, 0x2102, 0x0bae, 0x4d0f, 0x0409, 0x1a63, 0x54ba,
  28. 0x0523, 0x2c0f, 0x38fd, 0x252a, 0x5147, 0x4fea, 0x3455, 0x1d4d,
  29. 0x0c24, 0x3c7e, 0x33f4, 0x22d9, 0x4ee3, 0x37a7, 0x23dd, 0x08a3,
  30. 0x09f0, 0x0abc, 0x082f, 0x0917, 0x37a8, 0x0d34, 0x288b, 0x0f92,
  31. 0x0fd0, 0x3bb6, 0x1492, 0x1499, 0x15c2, 0x3d12, 0x178b, 0x3ff9,
  32. 0x1919, 0x1a43, 0x4063, 0x1bff, 0x38fd, 0x1f00, 0x4205, 0x208c,
  33. 0x03db, 0x4413, 0x1115, 0x21b9, 0x2e83, 0x47a4, 0x4695, 0x2593,
  34. 0x26ec, 0x27c3, 0x296c, 0x2af8, 0x2b97, 0x37a9, 0x2d90, 0x37aa,
  35. 0x2fb9, 0x37ab, 0x30cf, 0x2b5f, 0x36e0, 0x3221, 0x37ac, 0x50b9,
  36. 0x393f, 0x0471, 0x05a2, 0x101a, 0x38fd, 0x38fd, 0x38fd, 0x3568,
  37. 0x186b, 0x0576, 0x0e3d, 0x38fd, 0x2bd6, 0x437b, 0x2abf, 0x4c0d,
  38. 0x0781, 0x4a74, 0x137b, 0x4915, 0x4bbe, 0x37ad, 0x37ae, 0x1196,
  39. 0x37af, 0x38fd, 0x295b,
  40. };
  41. static const ucs4_t hkscs2001_2uni_upages[85] = {
  42. 0x03500, 0x03c00, 0x03d00, 0x03e00, 0x04000, 0x04200, 0x04b00, 0x04c00,
  43. 0x04e00, 0x04f00, 0x05000, 0x05100, 0x05300, 0x05400, 0x05700, 0x05800,
  44. 0x05a00, 0x05b00, 0x05c00, 0x05d00, 0x05e00, 0x05f00, 0x06100, 0x06500,
  45. 0x06700, 0x06900, 0x06a00, 0x06c00, 0x06d00, 0x07000, 0x07100, 0x07200,
  46. 0x07300, 0x07400, 0x07600, 0x07700, 0x07800, 0x07a00, 0x07b00, 0x07c00,
  47. 0x07d00, 0x07e00, 0x08200, 0x08500, 0x08600, 0x08800, 0x08b00, 0x08e00,
  48. 0x08f00, 0x09100, 0x09200, 0x09300, 0x09700, 0x09800, 0x09900, 0x09f00,
  49. 0x0ff00, 0x21400, 0x21900, 0x21d00, 0x22000, 0x22700, 0x23200, 0x23300,
  50. 0x23c00, 0x24100, 0x24500, 0x24900, 0x24a00, 0x25100, 0x25600, 0x25c00,
  51. 0x25d00, 0x26b00, 0x26d00, 0x26f00, 0x27100, 0x28700, 0x28900, 0x28a00,
  52. 0x28d00, 0x29900, 0x29c00, 0x2a100, 0x2a200,
  53. };
  54. static int
  55. hkscs2001_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
  56. {
  57. unsigned char c1 = s[0];
  58. if ((c1 == 0x8c)) {
  59. if (n >= 2) {
  60. unsigned char c2 = s[1];
  61. if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {
  62. unsigned int i = 157 * (c1 - 0x80) + (c2 - (c2 >= 0xa1 ? 0x62 : 0x40));
  63. ucs4_t wc = 0xfffd;
  64. unsigned short swc;
  65. {
  66. if (i < 2007)
  67. swc = hkscs2001_2uni_page8c[i-1884],
  68. wc = hkscs2001_2uni_upages[swc>>8] | (swc & 0xff);
  69. }
  70. if (wc != 0xfffd) {
  71. *pwc = wc;
  72. return 2;
  73. }
  74. }
  75. return RET_ILSEQ;
  76. }
  77. return RET_TOOFEW(0);
  78. }
  79. return RET_ILSEQ;
  80. }
  81. static const unsigned short hkscs2001_2charset[116] = {
  82. 0x8c4b, 0x8c56, 0x8c44, 0x8caa, 0x8c5d, 0x8cc3, 0x8c60, 0x8ccb,
  83. 0x8cc4, 0x8c58, 0x8c49, 0x8cd2, 0x8c72, 0x8c6f, 0x8c73, 0x8c70,
  84. 0x8c40, 0x8c71, 0x8c5b, 0x8c68, 0x8c75, 0x8ccc, 0x8c77, 0x8c78,
  85. 0x8cc5, 0x8cac, 0x8cd9, 0x8c48, 0x8cd4, 0x8c7a, 0x8c7b, 0x8c7c,
  86. 0x8c4d, 0x8c7e, 0x8c52, 0x8cca, 0x8ca2, 0x8ca3, 0x8c5e, 0x8ca5,
  87. 0x8c41, 0x8c67, 0x8c47, 0x8c51, 0x8ca7, 0x8ca9, 0x8c53, 0x8c5a,
  88. 0x8cad, 0x8c6b, 0x8c6e, 0x8c59, 0x8c63, 0x8cb1, 0x8cb2, 0x8cb3,
  89. 0x8c76, 0x8cdc, 0x8cb4, 0x8cd0, 0x8cb5, 0x8cbd, 0x8cb6, 0x8cce,
  90. 0x8c61, 0x8c45, 0x8cb8, 0x8cae, 0x8cba, 0x8c4f, 0x8cbc, 0x8c50,
  91. 0x8cbf, 0x8c6a, 0x8c66, 0x8cc9, 0x8cbe, 0x8c43, 0x8c6d, 0x8c74,
  92. 0x8cb7, 0x8cb9, 0x8cbb, 0x8cc0, 0x8cd7, 0x8cd8, 0x8cda, 0x8cc2,
  93. 0x8c57, 0x8c79, 0x8c69, 0x8c7d, 0x8c54, 0x8ca1, 0x8ca4, 0x8c46,
  94. 0x8ca8, 0x8ccf, 0x8cab, 0x8c4a, 0x8cb0, 0x8caf, 0x8c4c, 0x8cd5,
  95. 0x8cd3, 0x8cd6, 0x8cd1, 0x8c5c, 0x8c6c, 0x8c4e, 0x8c65, 0x8cc1,
  96. 0x8c64, 0x8c42, 0x8c55, 0x8c5f,
  97. };
  98. static const Summary16 hkscs2001_uni2indx_page35[6] = {
  99. /* 0x3500 */
  100. { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 },
  101. { 0, 0x0000 }, { 0, 0x0200 },
  102. };
  103. static const Summary16 hkscs2001_uni2indx_page3c[46] = {
  104. /* 0x3c00 */
  105. { 1, 0x0000 }, { 1, 0x0000 }, { 1, 0x0000 }, { 1, 0x0000 },
  106. { 1, 0x0000 }, { 1, 0x0000 }, { 1, 0x0000 }, { 1, 0x0000 },
  107. { 1, 0x0800 }, { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 },
  108. { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 },
  109. /* 0x3d00 */
  110. { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 },
  111. { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 },
  112. { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 }, { 2, 0x0000 },
  113. { 2, 0x0200 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
  114. /* 0x3e00 */
  115. { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
  116. { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
  117. { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 }, { 3, 0x0000 },
  118. { 3, 0x0000 }, { 3, 0x0800 },
  119. };
  120. static const Summary16 hkscs2001_uni2indx_page40[8] = {
  121. /* 0x4000 */
  122. { 4, 0x0200 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 },
  123. { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0000 }, { 5, 0x0002 },
  124. };
  125. static const Summary16 hkscs2001_uni2indx_page42[11] = {
  126. /* 0x4200 */
  127. { 6, 0x0000 }, { 6, 0x0000 }, { 6, 0x0008 }, { 7, 0x0000 },
  128. { 7, 0x0000 }, { 7, 0x0000 }, { 7, 0x0000 }, { 7, 0x0040 },
  129. { 8, 0x0000 }, { 8, 0x0000 }, { 8, 0x0004 },
  130. };
  131. static const Summary16 hkscs2001_uni2indx_page4b[25] = {
  132. /* 0x4b00 */
  133. { 9, 0x0000 }, { 9, 0x0001 }, { 10, 0x0001 }, { 11, 0x0000 },
  134. { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
  135. { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
  136. { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
  137. /* 0x4c00 */
  138. { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
  139. { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 }, { 11, 0x0000 },
  140. { 11, 0x0002 },
  141. };
  142. static const Summary16 hkscs2001_uni2indx_page4e[59] = {
  143. /* 0x4e00 */
  144. { 12, 0x0000 }, { 12, 0x0000 }, { 12, 0x8000 }, { 13, 0x0000 },
  145. { 13, 0x0000 }, { 13, 0x0000 }, { 13, 0x0000 }, { 13, 0x0000 },
  146. { 13, 0x0000 }, { 13, 0x0000 }, { 13, 0x0008 }, { 14, 0x0000 },
  147. { 14, 0x0000 }, { 14, 0x0000 }, { 14, 0x0000 }, { 14, 0x0000 },
  148. /* 0x4f00 */
  149. { 14, 0x0000 }, { 14, 0x0080 }, { 15, 0x0000 }, { 15, 0x0000 },
  150. { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 },
  151. { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 },
  152. { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0000 }, { 15, 0x0001 },
  153. /* 0x5000 */
  154. { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0000 }, { 16, 0x0800 },
  155. { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x0000 },
  156. { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x0000 }, { 17, 0x1000 },
  157. { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 },
  158. /* 0x5100 */
  159. { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 },
  160. { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x0000 },
  161. { 18, 0x0000 }, { 18, 0x0000 }, { 18, 0x4000 },
  162. };
  163. static const Summary16 hkscs2001_uni2indx_page53[20] = {
  164. /* 0x5300 */
  165. { 19, 0x0000 }, { 19, 0x0000 }, { 19, 0x0010 }, { 20, 0x0000 },
  166. { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 },
  167. { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 },
  168. { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 },
  169. /* 0x5400 */
  170. { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0000 }, { 20, 0x0010 },
  171. };
  172. static const Summary16 hkscs2001_uni2indx_page57[30] = {
  173. /* 0x5700 */
  174. { 21, 0x0000 }, { 21, 0x0000 }, { 21, 0x0000 }, { 21, 0x2000 },
  175. { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 },
  176. { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 },
  177. { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 },
  178. /* 0x5800 */
  179. { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 },
  180. { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 }, { 22, 0x0000 },
  181. { 22, 0x0000 }, { 22, 0x0004 }, { 23, 0x0000 }, { 23, 0x0000 },
  182. { 23, 0x0000 }, { 23, 0x0001 },
  183. };
  184. static const Summary16 hkscs2001_uni2indx_page5a[93] = {
  185. /* 0x5a00 */
  186. { 24, 0x0000 }, { 24, 0x0400 }, { 25, 0x0000 }, { 25, 0x0000 },
  187. { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 },
  188. { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 },
  189. { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 }, { 25, 0x0000 },
  190. /* 0x5b00 */
  191. { 25, 0x0000 }, { 25, 0x0020 }, { 26, 0x0000 }, { 26, 0x0000 },
  192. { 26, 0x0000 }, { 26, 0x0000 }, { 26, 0x0000 }, { 26, 0x0000 },
  193. { 26, 0x0000 }, { 26, 0x0040 }, { 27, 0x0000 }, { 27, 0x0000 },
  194. { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 },
  195. /* 0x5c00 */
  196. { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 },
  197. { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 },
  198. { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 },
  199. { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0000 }, { 27, 0x0020 },
  200. /* 0x5d00 */
  201. { 28, 0x0000 }, { 28, 0x0000 }, { 28, 0x0000 }, { 28, 0x0000 },
  202. { 28, 0x0000 }, { 28, 0x0000 }, { 28, 0x0000 }, { 28, 0x0800 },
  203. { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 },
  204. { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 },
  205. /* 0x5e00 */
  206. { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 },
  207. { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 }, { 29, 0x0000 },
  208. { 29, 0x0000 }, { 29, 0x0204 }, { 31, 0x0000 }, { 31, 0x0000 },
  209. { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 },
  210. /* 0x5f00 */
  211. { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 },
  212. { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 },
  213. { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 }, { 31, 0x0000 },
  214. { 31, 0x0004 },
  215. };
  216. static const Summary16 hkscs2001_uni2indx_page61[3] = {
  217. /* 0x6100 */
  218. { 32, 0x0000 }, { 32, 0x0000 }, { 32, 0x0004 },
  219. };
  220. static const Summary16 hkscs2001_uni2indx_page65[9] = {
  221. /* 0x6500 */
  222. { 33, 0x0000 }, { 33, 0x0000 }, { 33, 0x0000 }, { 33, 0x0000 },
  223. { 33, 0x0000 }, { 33, 0x0000 }, { 33, 0x0000 }, { 33, 0x0000 },
  224. { 33, 0x0800 },
  225. };
  226. static const Summary16 hkscs2001_uni2indx_page67[7] = {
  227. /* 0x6700 */
  228. { 34, 0x0000 }, { 34, 0x0200 }, { 35, 0x0000 }, { 35, 0x0000 },
  229. { 35, 0x0000 }, { 35, 0x0000 }, { 35, 0x0800 },
  230. };
  231. static const Summary16 hkscs2001_uni2indx_page69[23] = {
  232. /* 0x6900 */
  233. { 36, 0x0000 }, { 36, 0x0200 }, { 37, 0x0000 }, { 37, 0x0000 },
  234. { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 },
  235. { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 },
  236. { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 },
  237. /* 0x6a00 */
  238. { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 }, { 37, 0x0000 },
  239. { 37, 0x0008 }, { 38, 0x0000 }, { 38, 0x0008 },
  240. };
  241. static const Summary16 hkscs2001_uni2indx_page6c[32] = {
  242. /* 0x6c00 */
  243. { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 },
  244. { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 },
  245. { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 },
  246. { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x0000 }, { 39, 0x8000 },
  247. /* 0x6d00 */
  248. { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 },
  249. { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 },
  250. { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 },
  251. { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x0000 }, { 40, 0x4000 },
  252. };
  253. static const Summary16 hkscs2001_uni2indx_page70[76] = {
  254. /* 0x7000 */
  255. { 41, 0x0000 }, { 41, 0x0000 }, { 41, 0x0000 }, { 41, 0x0000 },
  256. { 41, 0x2000 }, { 42, 0x0000 }, { 42, 0x0000 }, { 42, 0x0080 },
  257. { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 },
  258. { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 },
  259. /* 0x7100 */
  260. { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 },
  261. { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 }, { 43, 0x0000 },
  262. { 43, 0x0000 }, { 43, 0x0002 }, { 44, 0x0000 }, { 44, 0x0000 },
  263. { 44, 0x0000 }, { 44, 0x0000 }, { 44, 0x0000 }, { 44, 0x0000 },
  264. /* 0x7200 */
  265. { 44, 0x0001 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  266. { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  267. { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  268. { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  269. /* 0x7300 */
  270. { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  271. { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 }, { 45, 0x0000 },
  272. { 45, 0x1000 }, { 46, 0x0000 }, { 46, 0x0000 }, { 46, 0x0400 },
  273. { 47, 0x0000 }, { 47, 0x0000 }, { 47, 0x0000 }, { 47, 0x0000 },
  274. /* 0x7400 */
  275. { 47, 0x0004 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 },
  276. { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 },
  277. { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0000 }, { 48, 0x0200 },
  278. };
  279. static const Summary16 hkscs2001_uni2indx_page76[47] = {
  280. /* 0x7600 */
  281. { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 },
  282. { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 },
  283. { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 }, { 49, 0x0000 },
  284. { 49, 0x0000 }, { 49, 0x0200 }, { 50, 0x0000 }, { 50, 0x0000 },
  285. /* 0x7700 */
  286. { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 },
  287. { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 },
  288. { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 }, { 50, 0x0000 },
  289. { 50, 0x0000 }, { 50, 0x2000 }, { 51, 0x0000 }, { 51, 0x0000 },
  290. /* 0x7800 */
  291. { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 },
  292. { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 },
  293. { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0000 },
  294. { 51, 0x0000 }, { 51, 0x0000 }, { 51, 0x0010 },
  295. };
  296. static const Summary16 hkscs2001_uni2indx_page7a[71] = {
  297. /* 0x7a00 */
  298. { 52, 0x0000 }, { 52, 0x0000 }, { 52, 0x0400 }, { 53, 0x0000 },
  299. { 53, 0x0000 }, { 53, 0x0000 }, { 53, 0x0000 }, { 53, 0x0000 },
  300. { 53, 0x0000 }, { 53, 0x0008 }, { 54, 0x0000 }, { 54, 0x0000 },
  301. { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 },
  302. /* 0x7b00 */
  303. { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 },
  304. { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 },
  305. { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x0000 },
  306. { 54, 0x0000 }, { 54, 0x0000 }, { 54, 0x1000 }, { 55, 0x0000 },
  307. /* 0x7c00 */
  308. { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
  309. { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
  310. { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 }, { 55, 0x0000 },
  311. { 55, 0x0008 }, { 56, 0x0000 }, { 56, 0x0000 }, { 56, 0x0000 },
  312. /* 0x7d00 */
  313. { 56, 0x0000 }, { 56, 0x0000 }, { 56, 0x0000 }, { 56, 0x0000 },
  314. { 56, 0x0000 }, { 56, 0x0000 }, { 56, 0x0000 }, { 56, 0x0000 },
  315. { 56, 0x0800 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 },
  316. { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 },
  317. /* 0x7e00 */
  318. { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 }, { 57, 0x0000 },
  319. { 57, 0x0000 }, { 57, 0x0800 }, { 58, 0x1000 },
  320. };
  321. static const Summary16 hkscs2001_uni2indx_page82[16] = {
  322. /* 0x8200 */
  323. { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 },
  324. { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 },
  325. { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x0000 }, { 59, 0x8000 },
  326. { 60, 0x0000 }, { 60, 0x0000 }, { 60, 0x0000 }, { 60, 0x0100 },
  327. };
  328. static const Summary16 hkscs2001_uni2indx_page85[17] = {
  329. /* 0x8500 */
  330. { 61, 0x0000 }, { 61, 0x0000 }, { 61, 0x0000 }, { 61, 0x0000 },
  331. { 61, 0x0000 }, { 61, 0x8000 }, { 62, 0x0000 }, { 62, 0x0000 },
  332. { 62, 0x0000 }, { 62, 0x0080 }, { 63, 0x0000 }, { 63, 0x0000 },
  333. { 63, 0x0000 }, { 63, 0x0040 }, { 64, 0x0000 }, { 64, 0x0000 },
  334. /* 0x8600 */
  335. { 64, 0x8000 },
  336. };
  337. static const Summary16 hkscs2001_uni2indx_page88[10] = {
  338. /* 0x8800 */
  339. { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 },
  340. { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 }, { 65, 0x0000 },
  341. { 65, 0x8000 }, { 66, 0x0001 },
  342. };
  343. static const Summary16 hkscs2001_uni2indx_page8b[9] = {
  344. /* 0x8b00 */
  345. { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 },
  346. { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 }, { 67, 0x0000 },
  347. { 67, 0x0008 },
  348. };
  349. static const Summary16 hkscs2001_uni2indx_page8e[29] = {
  350. /* 0x8e00 */
  351. { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 },
  352. { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 },
  353. { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0000 }, { 68, 0x0200 },
  354. { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 },
  355. /* 0x8f00 */
  356. { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 },
  357. { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0000 },
  358. { 69, 0x0000 }, { 69, 0x0000 }, { 69, 0x0080 }, { 70, 0x0000 },
  359. { 70, 0x8000 },
  360. };
  361. static const Summary16 hkscs2001_uni2indx_page91[48] = {
  362. /* 0x9100 */
  363. { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 },
  364. { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 },
  365. { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 },
  366. { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0000 }, { 71, 0x0040 },
  367. /* 0x9200 */
  368. { 72, 0x0000 }, { 72, 0x0000 }, { 72, 0x0002 }, { 73, 0x0000 },
  369. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  370. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  371. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  372. /* 0x9300 */
  373. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  374. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  375. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 },
  376. { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0000 }, { 73, 0x0010 },
  377. };
  378. static const Summary16 hkscs2001_uni2indx_page97[47] = {
  379. /* 0x9700 */
  380. { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 }, { 74, 0x0000 },
  381. { 74, 0x0000 }, { 74, 0x0020 }, { 75, 0x0000 }, { 75, 0x0000 },
  382. { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
  383. { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
  384. /* 0x9800 */
  385. { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0000 },
  386. { 75, 0x0000 }, { 75, 0x0000 }, { 75, 0x0100 }, { 76, 0x0000 },
  387. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
  388. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
  389. /* 0x9900 */
  390. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
  391. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
  392. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0000 },
  393. { 76, 0x0000 }, { 76, 0x0000 }, { 76, 0x0001 },
  394. };
  395. static const Summary16 hkscs2001_uni2indx_page9f[11] = {
  396. /* 0x9f00 */
  397. { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0x0000 },
  398. { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0x0000 },
  399. { 77, 0x0000 }, { 77, 0x0000 }, { 77, 0xffc0 },
  400. };
  401. static const Summary16 hkscs2001_uni2indx_page214[4] = {
  402. /* 0x21400 */
  403. { 87, 0x0000 }, { 87, 0x0000 }, { 87, 0x0000 }, { 87, 0x8000 },
  404. };
  405. static const Summary16 hkscs2001_uni2indx_page219[9] = {
  406. /* 0x21900 */
  407. { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 },
  408. { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 }, { 88, 0x0000 },
  409. { 88, 0x0001 },
  410. };
  411. static const Summary16 hkscs2001_uni2indx_page21d[12] = {
  412. /* 0x21d00 */
  413. { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 },
  414. { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 },
  415. { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0000 }, { 89, 0x0040 },
  416. };
  417. static const Summary16 hkscs2001_uni2indx_page220[8] = {
  418. /* 0x22000 */
  419. { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 },
  420. { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x0000 }, { 90, 0x4000 },
  421. };
  422. static const Summary16 hkscs2001_uni2indx_page227[2] = {
  423. /* 0x22700 */
  424. { 91, 0x0000 }, { 91, 0x0004 },
  425. };
  426. static const Summary16 hkscs2001_uni2indx_page232[32] = {
  427. /* 0x23200 */
  428. { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 },
  429. { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 }, { 92, 0x0000 },
  430. { 92, 0x0002 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
  431. { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
  432. /* 0x23300 */
  433. { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
  434. { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
  435. { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 },
  436. { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0000 }, { 93, 0x0200 },
  437. };
  438. static const Summary16 hkscs2001_uni2indx_page23c[7] = {
  439. /* 0x23c00 */
  440. { 94, 0x0000 }, { 94, 0x0000 }, { 94, 0x0000 }, { 94, 0x0000 },
  441. { 94, 0x0000 }, { 94, 0x0000 }, { 94, 0x0008 },
  442. };
  443. static const Summary16 hkscs2001_uni2indx_page241[5] = {
  444. /* 0x24100 */
  445. { 95, 0x0000 }, { 95, 0x0000 }, { 95, 0x0000 }, { 95, 0x0000 },
  446. { 95, 0x4000 },
  447. };
  448. static const Summary16 hkscs2001_uni2indx_page245[1] = {
  449. /* 0x24500 */
  450. { 96, 0x0020 },
  451. };
  452. static const Summary16 hkscs2001_uni2indx_page249[18] = {
  453. /* 0x24900 */
  454. { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 },
  455. { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0000 }, { 97, 0x0800 },
  456. { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 },
  457. { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 }, { 98, 0x0000 },
  458. /* 0x24a00 */
  459. { 98, 0x0000 }, { 98, 0x0008 },
  460. };
  461. static const Summary16 hkscs2001_uni2indx_page251[13] = {
  462. /* 0x25100 */
  463. { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 },
  464. { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 },
  465. { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 }, { 99, 0x0000 },
  466. { 99, 0x2000 },
  467. };
  468. static const Summary16 hkscs2001_uni2indx_page256[10] = {
  469. /* 0x25600 */
  470. { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
  471. { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 }, { 100, 0x0000 },
  472. { 100, 0x0000 }, { 100, 0x0020 },
  473. };
  474. static const Summary16 hkscs2001_uni2indx_page25c[20] = {
  475. /* 0x25c00 */
  476. { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 },
  477. { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0000 },
  478. { 101, 0x0000 }, { 101, 0x0000 }, { 101, 0x0010 }, { 102, 0x0000 },
  479. { 102, 0x0000 }, { 102, 0x0000 }, { 102, 0x0000 }, { 102, 0x0000 },
  480. /* 0x25d00 */
  481. { 102, 0x0000 }, { 102, 0x0000 }, { 102, 0x0000 }, { 102, 0x0001 },
  482. };
  483. static const Summary16 hkscs2001_uni2indx_page26b[2] = {
  484. /* 0x26b00 */
  485. { 103, 0x0000 }, { 103, 0x0020 },
  486. };
  487. static const Summary16 hkscs2001_uni2indx_page26d[8] = {
  488. /* 0x26d00 */
  489. { 104, 0x0000 }, { 104, 0x0000 }, { 104, 0x0000 }, { 104, 0x0000 },
  490. { 104, 0x0000 }, { 104, 0x0000 }, { 104, 0x0000 }, { 104, 0x0010 },
  491. };
  492. static const Summary16 hkscs2001_uni2indx_page26f[12] = {
  493. /* 0x26f00 */
  494. { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
  495. { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 },
  496. { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x0000 }, { 105, 0x4000 },
  497. };
  498. static const Summary16 hkscs2001_uni2indx_page271[1] = {
  499. /* 0x27100 */
  500. { 106, 0x2000 },
  501. };
  502. static const Summary16 hkscs2001_uni2indx_page287[1] = {
  503. /* 0x28700 */
  504. { 107, 0x8000 },
  505. };
  506. static const Summary16 hkscs2001_uni2indx_page289[31] = {
  507. /* 0x28900 */
  508. { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
  509. { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
  510. { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0000 },
  511. { 108, 0x0000 }, { 108, 0x0000 }, { 108, 0x0008 }, { 109, 0x0000 },
  512. /* 0x28a00 */
  513. { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x0000 }, { 109, 0x0004 },
  514. { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 },
  515. { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0000 },
  516. { 110, 0x0000 }, { 110, 0x0000 }, { 110, 0x0400 },
  517. };
  518. static const Summary16 hkscs2001_uni2indx_page28d[12] = {
  519. /* 0x28d00 */
  520. { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 },
  521. { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 },
  522. { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0000 }, { 111, 0x0200 },
  523. };
  524. static const Summary16 hkscs2001_uni2indx_page299[5] = {
  525. /* 0x29900 */
  526. { 112, 0x0000 }, { 112, 0x0000 }, { 112, 0x0000 }, { 112, 0x0000 },
  527. { 112, 0x0080 },
  528. };
  529. static const Summary16 hkscs2001_uni2indx_page29c[8] = {
  530. /* 0x29c00 */
  531. { 113, 0x0000 }, { 113, 0x0000 }, { 113, 0x0000 }, { 113, 0x0000 },
  532. { 113, 0x0000 }, { 113, 0x0000 }, { 113, 0x0000 }, { 113, 0x0008 },
  533. };
  534. static const Summary16 hkscs2001_uni2indx_page2a1[28] = {
  535. /* 0x2a100 */
  536. { 114, 0x0080 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  537. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  538. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  539. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  540. /* 0x2a200 */
  541. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  542. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 },
  543. { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0000 }, { 115, 0x0400 },
  544. };
  545. static int
  546. hkscs2001_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
  547. {
  548. if (n >= 2) {
  549. const Summary16 *summary = NULL;
  550. if (wc < 0x9f00) {
  551. if (wc < 0x6900) {
  552. if (wc >= 0x3500 && wc < 0x3560)
  553. summary = &hkscs2001_uni2indx_page35[(wc>>4)-0x350];
  554. else if (wc >= 0x3c00 && wc < 0x3ee0)
  555. summary = &hkscs2001_uni2indx_page3c[(wc>>4)-0x3c0];
  556. else if (wc >= 0x4000 && wc < 0x4080)
  557. summary = &hkscs2001_uni2indx_page40[(wc>>4)-0x400];
  558. else if (wc >= 0x4200 && wc < 0x42b0)
  559. summary = &hkscs2001_uni2indx_page42[(wc>>4)-0x420];
  560. else if (wc >= 0x4b00 && wc < 0x4c90)
  561. summary = &hkscs2001_uni2indx_page4b[(wc>>4)-0x4b0];
  562. else if (wc >= 0x4e00 && wc < 0x51b0)
  563. summary = &hkscs2001_uni2indx_page4e[(wc>>4)-0x4e0];
  564. else if (wc >= 0x5300 && wc < 0x5440)
  565. summary = &hkscs2001_uni2indx_page53[(wc>>4)-0x530];
  566. else if (wc >= 0x5700 && wc < 0x58e0)
  567. summary = &hkscs2001_uni2indx_page57[(wc>>4)-0x570];
  568. else if (wc >= 0x5a00 && wc < 0x5fd0)
  569. summary = &hkscs2001_uni2indx_page5a[(wc>>4)-0x5a0];
  570. else if (wc >= 0x6100 && wc < 0x6130)
  571. summary = &hkscs2001_uni2indx_page61[(wc>>4)-0x610];
  572. else if (wc >= 0x6500 && wc < 0x6590)
  573. summary = &hkscs2001_uni2indx_page65[(wc>>4)-0x650];
  574. else if (wc >= 0x6700 && wc < 0x6770)
  575. summary = &hkscs2001_uni2indx_page67[(wc>>4)-0x670];
  576. } else {
  577. if (wc >= 0x6900 && wc < 0x6a70)
  578. summary = &hkscs2001_uni2indx_page69[(wc>>4)-0x690];
  579. else if (wc >= 0x6c00 && wc < 0x6e00)
  580. summary = &hkscs2001_uni2indx_page6c[(wc>>4)-0x6c0];
  581. else if (wc >= 0x7000 && wc < 0x74c0)
  582. summary = &hkscs2001_uni2indx_page70[(wc>>4)-0x700];
  583. else if (wc >= 0x7600 && wc < 0x78f0)
  584. summary = &hkscs2001_uni2indx_page76[(wc>>4)-0x760];
  585. else if (wc >= 0x7a00 && wc < 0x7e70)
  586. summary = &hkscs2001_uni2indx_page7a[(wc>>4)-0x7a0];
  587. else if (wc >= 0x8200 && wc < 0x8300)
  588. summary = &hkscs2001_uni2indx_page82[(wc>>4)-0x820];
  589. else if (wc >= 0x8500 && wc < 0x8610)
  590. summary = &hkscs2001_uni2indx_page85[(wc>>4)-0x850];
  591. else if (wc >= 0x8800 && wc < 0x88a0)
  592. summary = &hkscs2001_uni2indx_page88[(wc>>4)-0x880];
  593. else if (wc >= 0x8b00 && wc < 0x8b90)
  594. summary = &hkscs2001_uni2indx_page8b[(wc>>4)-0x8b0];
  595. else if (wc >= 0x8e00 && wc < 0x8fd0)
  596. summary = &hkscs2001_uni2indx_page8e[(wc>>4)-0x8e0];
  597. else if (wc >= 0x9100 && wc < 0x9400)
  598. summary = &hkscs2001_uni2indx_page91[(wc>>4)-0x910];
  599. else if (wc >= 0x9700 && wc < 0x99f0)
  600. summary = &hkscs2001_uni2indx_page97[(wc>>4)-0x970];
  601. }
  602. } else {
  603. if (wc < 0x25600) {
  604. if (wc >= 0x9f00 && wc < 0x9fb0)
  605. summary = &hkscs2001_uni2indx_page9f[(wc>>4)-0x9f0];
  606. else if (wc >= 0x21400 && wc < 0x21440)
  607. summary = &hkscs2001_uni2indx_page214[(wc>>4)-0x2140];
  608. else if (wc >= 0x21900 && wc < 0x21990)
  609. summary = &hkscs2001_uni2indx_page219[(wc>>4)-0x2190];
  610. else if (wc >= 0x21d00 && wc < 0x21dc0)
  611. summary = &hkscs2001_uni2indx_page21d[(wc>>4)-0x21d0];
  612. else if (wc >= 0x22000 && wc < 0x22080)
  613. summary = &hkscs2001_uni2indx_page220[(wc>>4)-0x2200];
  614. else if (wc >= 0x22700 && wc < 0x22720)
  615. summary = &hkscs2001_uni2indx_page227[(wc>>4)-0x2270];
  616. else if (wc >= 0x23200 && wc < 0x23400)
  617. summary = &hkscs2001_uni2indx_page232[(wc>>4)-0x2320];
  618. else if (wc >= 0x23c00 && wc < 0x23c70)
  619. summary = &hkscs2001_uni2indx_page23c[(wc>>4)-0x23c0];
  620. else if (wc >= 0x24100 && wc < 0x24150)
  621. summary = &hkscs2001_uni2indx_page241[(wc>>4)-0x2410];
  622. else if (wc >= 0x24500 && wc < 0x24510)
  623. summary = &hkscs2001_uni2indx_page245[(wc>>4)-0x2450];
  624. else if (wc >= 0x24900 && wc < 0x24a20)
  625. summary = &hkscs2001_uni2indx_page249[(wc>>4)-0x2490];
  626. else if (wc >= 0x25100 && wc < 0x251d0)
  627. summary = &hkscs2001_uni2indx_page251[(wc>>4)-0x2510];
  628. } else {
  629. if (wc >= 0x25600 && wc < 0x256a0)
  630. summary = &hkscs2001_uni2indx_page256[(wc>>4)-0x2560];
  631. else if (wc >= 0x25c00 && wc < 0x25d40)
  632. summary = &hkscs2001_uni2indx_page25c[(wc>>4)-0x25c0];
  633. else if (wc >= 0x26b00 && wc < 0x26b20)
  634. summary = &hkscs2001_uni2indx_page26b[(wc>>4)-0x26b0];
  635. else if (wc >= 0x26d00 && wc < 0x26d80)
  636. summary = &hkscs2001_uni2indx_page26d[(wc>>4)-0x26d0];
  637. else if (wc >= 0x26f00 && wc < 0x26fc0)
  638. summary = &hkscs2001_uni2indx_page26f[(wc>>4)-0x26f0];
  639. else if (wc >= 0x27100 && wc < 0x27110)
  640. summary = &hkscs2001_uni2indx_page271[(wc>>4)-0x2710];
  641. else if (wc >= 0x28700 && wc < 0x28710)
  642. summary = &hkscs2001_uni2indx_page287[(wc>>4)-0x2870];
  643. else if (wc >= 0x28900 && wc < 0x28af0)
  644. summary = &hkscs2001_uni2indx_page289[(wc>>4)-0x2890];
  645. else if (wc >= 0x28d00 && wc < 0x28dc0)
  646. summary = &hkscs2001_uni2indx_page28d[(wc>>4)-0x28d0];
  647. else if (wc >= 0x29900 && wc < 0x29950)
  648. summary = &hkscs2001_uni2indx_page299[(wc>>4)-0x2990];
  649. else if (wc >= 0x29c00 && wc < 0x29c80)
  650. summary = &hkscs2001_uni2indx_page29c[(wc>>4)-0x29c0];
  651. else if (wc >= 0x2a100 && wc < 0x2a2c0)
  652. summary = &hkscs2001_uni2indx_page2a1[(wc>>4)-0x2a10];
  653. }
  654. }
  655. if (summary) {
  656. unsigned short used = summary->used;
  657. unsigned int i = wc & 0x0f;
  658. if (used & ((unsigned short) 1 << i)) {
  659. unsigned short c;
  660. /* Keep in 'used' only the bits 0..i-1. */
  661. used &= ((unsigned short) 1 << i) - 1;
  662. /* Add 'summary->indx' and the number of bits set in 'used'. */
  663. used = (used & 0x5555) + ((used & 0xaaaa) >> 1);
  664. used = (used & 0x3333) + ((used & 0xcccc) >> 2);
  665. used = (used & 0x0f0f) + ((used & 0xf0f0) >> 4);
  666. used = (used & 0x00ff) + (used >> 8);
  667. c = hkscs2001_2charset[summary->indx + used];
  668. r[0] = (c >> 8); r[1] = (c & 0xff);
  669. return 2;
  670. }
  671. }
  672. return RET_ILUNI;
  673. }
  674. return RET_TOOSMALL;
  675. }