--- icu/source/common/ucnv2022.c.orig Thu Sep 9 01:18:15 2010
+++ icu/source/common/ucnv2022.c Mon Dec 6 15:47:18 2010
@@ -167,8 +167,13 @@
*/
enum { MAX_JA_VERSION=4 };
static const uint16_t jpCharsetMasks[MAX_JA_VERSION+1]={
+ /*
+ * Sun modification
+ * We support JISX212 at ISO-2022-JP too.
CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT),
+ */
CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212),
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212),
CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7),
CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7),
CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7)
--- icu/source/common/ucnv2022.c.orig 2009-05-22 15:45:08.437653452 +0800
+++ icu/source/common/ucnv2022.c 2009-05-22 15:46:31.620400264 +0800
@@ -1675,7 +1685,10 @@
choices[choiceCount++] = (int8_t)HWKANA_7BIT;
}
/* Do not try single-byte half-width Katakana for other versions. */
+ /* Sun modification: we need support it */
+ /*
csm &= ~CSM(HWKANA_7BIT);
+ */
/* try the current G0 charset */
choices[choiceCount++] = cs = pFromU2022State->cs[0];
@@ -1757,6 +1770,11 @@
g = 0;
}
/* else do not use HWKANA_7BIT with other versions */
+ else { /* Sun modification: we need to support it */
+ targetValue = (uint32_t)(sourceChar - (HWKANA_START - 0x21));
+ len = 1;
+ cs = cs0;
+ }
}
break;
case JISX201:
@@ -2085,18 +2085,21 @@
mySource--;
escape:
{
+ /* SUN modification
const char * mySourceBefore = mySource;
int8_t toULengthBefore = args->converter->toULength;
-
+ */
changeState_2022(args->converter,&(mySource),
mySourceLimit, ISO_2022_JP,err);
/* If in ISO-2022-JP only and we successully completed an escape sequence, but previous segment was empty, create an error */
+ /*
if(myData->version==0 && myData->key==0 && U_SUCCESS(*err) && myData->isEmptySegment) {
*err = U_ILLEGAL_ESCAPE_SEQUENCE;
args->converter->toUCallbackReason = UCNV_IRREGULAR;
args->converter->toULength = (int8_t)(toULengthBefore + (mySource - mySourceBefore));
}
+ */
}
/* invalid or illegal escape sequence */
@@ -3713,7 +3735,10 @@
UCNV_IBM,
UCNV_ISO_2022,
1,
- 3, /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
+ /*
+ * Sun modification: 4936232
+ 3, */ /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
+ 9,
{ 0x1a, 0, 0, 0 },
1,
FALSE,
@@ -3763,7 +3788,10 @@
UCNV_IBM,
UCNV_ISO_2022,
1,
- 6, /* max 6 bytes per UChar: 4-byte escape sequence + DBCS */
+ /*
+ * Sun modification: 4936232
+ 6, */ /* max 6 bytes per UChar: 4-byte escape sequence + DBCS */
+ 9,
{ 0x1a, 0, 0, 0 },
1,
FALSE,
@@ -3813,7 +3841,10 @@
UCNV_IBM,
UCNV_ISO_2022,
1,
- 3, /* max 3 bytes per UChar: SO+DBCS */
+ /*
+ * Sun modification: 4936232
+ 3, */ /* max 3 bytes per UChar: SO+DBCS */
+ 8,
{ 0x1a, 0, 0, 0 },
1,
FALSE,