ICU-11869 Update 2022 code in ICU4C

X-SVN-Rev: 38014
This commit is contained in:
Michael Ow 2015-09-23 20:49:25 +00:00
parent 953f033293
commit 04b5b54998
2 changed files with 9 additions and 35 deletions

View File

@ -1418,19 +1418,6 @@ toUnicodeCallback(UConverter *cnv,
/* preference order of JP charsets */ /* preference order of JP charsets */
static const StateEnum jpCharsetPref[]={ static const StateEnum jpCharsetPref[]={
ASCII,
JISX201,
ISO8859_1,
ISO8859_7,
JISX208,
JISX212,
GB2312,
KSC5601,
HWKANA_7BIT
};
/* alternate preference order of JP charsets for version 2,3,4*/
static const StateEnum jpCharsetPref_alt[]={
ASCII, ASCII,
JISX201, JISX201,
ISO8859_1, ISO8859_1,
@ -1769,26 +1756,13 @@ getTrail:
choices[choiceCount++] = cs; choices[choiceCount++] = cs;
csm &= ~CSM(cs); csm &= ~CSM(cs);
} }
/* /* try all the other possible charsets */
* version 2,3,4 of JP iso 2022 requires a different preference order for the possible charsets is there is no previous state set for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref); ++i) {
*/ cs = (int8_t)jpCharsetPref[i];
if (cs == 0 && converterData->version >= 2) { if(CSM(cs) & csm) {
for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref_alt); ++i) { choices[choiceCount++] = cs;
cs = (int8_t)jpCharsetPref_alt[i]; csm &= ~CSM(cs);
if(CSM(cs) & csm) {
choices[choiceCount++] = cs;
csm &= ~CSM(cs);
}
}
} else {
/* try all the other possible charsets */
for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref); ++i) {
cs = (int8_t)jpCharsetPref[i];
if(CSM(cs) & csm) {
choices[choiceCount++] = cs;
csm &= ~CSM(cs);
}
} }
} }
} }

View File

@ -1262,8 +1262,8 @@ conversion:table(nofallback) {
{ {
"ISO-2022-JP-2", "ISO-2022-JP-2",
"?@A\u00e4\u03b1\u203EB", "?@A\u00e4\u03b1\u203EB",
:bin{ 3f40411B2E411B4E641B2E461B4E611B284A7E421B2842 }, :bin{ 3f40411B2E411B4E641b244226411b284a7e421b2842 },
:intvector{ 0,1,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6 }, :intvector{ 0,1,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6 },
:int{1}, :int{1}, "", "?", "" :int{1}, :int{1}, "", "?", ""
} }