comparison src/coding.c @ 89842:b5f22f538c1f

(decode_coding_utf_16): Fix handling of surrogate pare.
author Kenichi Handa <handa@m17n.org>
date Thu, 04 Mar 2004 07:49:18 +0000
parents a53cb5864a40
children 3edfa038a435
comparison
equal deleted inserted replaced
89841:dba335b3b492 89842:b5f22f538c1f
1493 } 1493 }
1494 else 1494 else
1495 { 1495 {
1496 c = ((surrogate - 0xD800) << 10) | (c - 0xDC00); 1496 c = ((surrogate - 0xD800) << 10) | (c - 0xDC00);
1497 CODING_UTF_16_SURROGATE (coding) = surrogate = 0; 1497 CODING_UTF_16_SURROGATE (coding) = surrogate = 0;
1498 *charbuf++ = c; 1498 *charbuf++ = 0x10000 + c;
1499 } 1499 }
1500 } 1500 }
1501 else 1501 else
1502 { 1502 {
1503 if (UTF_16_HIGH_SURROGATE_P (c)) 1503 if (UTF_16_HIGH_SURROGATE_P (c))