open-src/lib/libX11/sun-src/src/xlibi18n/lcUniConv/ksc5601_1992.h
changeset 1186 7d25a7879b31
parent 986 4c9f2c882fac
equal deleted inserted replaced
1185:f9e65ceb1a8a 1186:7d25a7879b31
  4120 0xd3ba, 0xd3bb, 0xd3bc, 0xd3bd,     
  4120 0xd3ba, 0xd3bb, 0xd3bc, 0xd3bd,     
  4121 };
  4121 };
  4122 /*
  4122 /*
  4123  *Private Use Zone for Korean.
  4123  *Private Use Zone for Korean.
  4124  */
  4124  */
  4125 static const unsigned short usc_tab_f7[188] = {
  4125 static const unsigned short ucs_tab_f7[188] = {
  4126 0xd831, 0xd832, 0xd833, 0xd834, 0xd835, 0xd836, 0xd837, 0xd838, 
  4126 0xd831, 0xd832, 0xd833, 0xd834, 0xd835, 0xd836, 0xd837, 0xd838, 
  4127 0xd839, 0xd83a, 0xd83b, 0xd83c, 0xd83d, 0xd83e, 0xd83f, 0xd840, 
  4127 0xd839, 0xd83a, 0xd83b, 0xd83c, 0xd83d, 0xd83e, 0xd83f, 0xd840, 
  4128 0xd841, 0xd842, 0xd843, 0xd844, 0xd845, 0xd846, 0xd847, 0xd848, 
  4128 0xd841, 0xd842, 0xd843, 0xd844, 0xd845, 0xd846, 0xd847, 0xd848, 
  4129 0xd849, 0xd84a, 0xd84b, 0xd84c, 0xd84d, 0xd84e, 0xd84f, 0xd850, 
  4129 0xd849, 0xd84a, 0xd84b, 0xd84c, 0xd84d, 0xd84e, 0xd84f, 0xd850, 
  4130 0xd851, 0xd852, 0xd853, 0xd854, 0xd855, 0xd856, 0xd857, 0xd858, 
  4130 0xd851, 0xd852, 0xd853, 0xd854, 0xd855, 0xd856, 0xd857, 0xd858, 
  4168         unsigned short c = ucs_hangul[wc-0xAC00];
  4168         unsigned short c = ucs_hangul[wc-0xAC00];
  4169         r[0] = (c >> 8); r[1] = (c & 0xff);
  4169         r[0] = (c >> 8); r[1] = (c & 0xff);
  4170         return 2;
  4170         return 2;
  4171     }
  4171     }
  4172     if (wc>=0xf700 && wc<=0xf7bb) {
  4172     if (wc>=0xf700 && wc<=0xf7bb) {
  4173         unsigned short c = usc_tab_f7[wc-0xf700];
  4173         unsigned short c = ucs_tab_f7[wc-0xf700];
  4174         r[0] = (c >> 8); r[1] = (c & 0xff);
  4174         r[0] = (c >> 8); r[1] = (c & 0xff);
  4175         return 2;
  4175         return 2;
  4176     }
  4176     }
  4177     
  4177     
  4178     if (wc == 0x30FB) {
  4178     if (wc == 0x30FB) {
  4207             if (ret != 2) abort();
  4207             if (ret != 2) abort();
  4208             if (n < 2)
  4208             if (n < 2)
  4209                 return RET_TOOSMALL;
  4209                 return RET_TOOSMALL;
  4210             if (((buf[0] >= 0x21 && buf[0] <= 0x2c) || (buf[0] >= 0x4a && buf[0] <= 0x7d))
  4210             if (((buf[0] >= 0x21 && buf[0] <= 0x2c) || (buf[0] >= 0x4a && buf[0] <= 0x7d))
  4211                 && (buf[1] >= 0x21 && buf[1] <= 0x7e)) {
  4211                 && (buf[1] >= 0x21 && buf[1] <= 0x7e)) {
  4212                 /*Pre-calculations: 0x192=0x1b2-0x21; 0x176=0x197-0x21 */
  4212                 /*Pre-calculations: 0x191=0x1b2-0x21; 0x176=0x197-0x21 */
  4213                 unsigned int t = buf[0] < 0x4A ? (buf[0]+0x192) : (buf[0]+0x176);
  4213                 unsigned int t = buf[0] < 0x4A ? (buf[0]+0x191) : (buf[0]+0x176);
  4214                 unsigned char t2 = ((t & 1) ? 0x5e : 0) + (buf[1] - 0x21);
  4214                 unsigned char t2 = ((t & 1) ? 0x5e : 0) + (buf[1] - 0x21);
  4215                 r[0] = t >> 1;
  4215                 r[0] = t >> 1;
  4216                 r[1] = (t2 < 0x4e ? t2+0x31 : t2+0x43);
  4216                 r[1] = (t2 < 0x4e ? t2+0x31 : t2+0x43);
  4217                 return 2;
  4217                 return 2;
  4218             }
  4218             }