From 7cf24f0c79bb08feb4ae36fbc8b7f16b904c2bc3 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Mon, 7 Jun 2004 17:03:34 +0000 Subject: [PATCH] Port Bug #245693 --> Unicode->EUC-KR converter loses data on encountering characters not representable in 2bytes git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@157512 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/intl/uconv/src/ugen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/intl/uconv/src/ugen.c b/mozilla/intl/uconv/src/ugen.c index b8b2f36a90e..1870ed85ce6 100644 --- a/mozilla/intl/uconv/src/ugen.c +++ b/mozilla/intl/uconv/src/ugen.c @@ -783,8 +783,16 @@ PRIVATE PRBool uCnGAlways8BytesDecomposedHangul( VIndex = (SIndex % NCount) / TCount; TIndex = SIndex % TCount; + /* + * A Hangul syllable not enumerated in KS X 1001 is represented + * by a sequence of 8 bytes beginning with Hangul-filler + * (0xA4D4 in EUC-KR and 0x2454 in ISO-2022-KR) followed by three + * Jamos (2 bytes each the first of which is 0xA4 in EUC-KR) making + * up the syllable. ref. KS X 1001:1998 Annex 3 + */ *outlen = 8; out[0] = out[2] = out[4] = out[6] = 0xa4; + out[1] = 0xd4; out[3] = lMap[LIndex] ; out[5] = (VIndex + 0xbf); out[7] = tMap[TIndex];