by Chih-Chang Hsi. See "A Patch for MIC to EUC_TW code converting in
mb support" posting in pgsql-patches list dated 09 Nov 2000.
{
len -= pg_mic_mblen(mic++);
- if (c1 == LC_CNS11643_1 || c1 == LC_CNS11643_2)
+ if (c1 == LC_CNS11643_1)
{
*p++ = *mic++;
*p++ = *mic++;
}
+ else if (c1 == LC_CNS11643_2)
+ {
+ *p++ = SS2;
+ *p++ = 0xa2;
+ *p++ = *mic++;
+ *p++ = *mic++;
+ }
else if (c1 == 0x9d)
{ /* LCPRV2? */
*p++ = SS2;
- *p++ = c1 - LC_CNS11643_3 + 0xa3;
+ *p++ = *mic++ - LC_CNS11643_3 + 0xa3;
*p++ = *mic++;
*p++ = *mic++;
}
unsigned short big5buf,
cnsBuf;
unsigned char lc;
- char bogusBuf[2];
+ char bogusBuf[3];
int i;
while (len > 0 && (c1 = *big5++))