ICU-11869 Update 2022 code in ICU4C
X-SVN-Rev: 38014
This commit is contained in:
parent
953f033293
commit
04b5b54998
@ -1418,19 +1418,6 @@ toUnicodeCallback(UConverter *cnv,
|
||||
|
||||
/* preference order of JP charsets */
|
||||
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,
|
||||
JISX201,
|
||||
ISO8859_1,
|
||||
@ -1769,26 +1756,13 @@ getTrail:
|
||||
choices[choiceCount++] = cs;
|
||||
csm &= ~CSM(cs);
|
||||
}
|
||||
|
||||
/*
|
||||
* version 2,3,4 of JP iso 2022 requires a different preference order for the possible charsets is there is no previous state set
|
||||
*/
|
||||
if (cs == 0 && converterData->version >= 2) {
|
||||
for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref_alt); ++i) {
|
||||
cs = (int8_t)jpCharsetPref_alt[i];
|
||||
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);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
icu4c/source/test/testdata/conversion.txt
vendored
4
icu4c/source/test/testdata/conversion.txt
vendored
@ -1262,8 +1262,8 @@ conversion:table(nofallback) {
|
||||
{
|
||||
"ISO-2022-JP-2",
|
||||
"?@A\u00e4\u03b1\u203EB",
|
||||
:bin{ 3f40411B2E411B4E641B2E461B4E611B284A7E421B2842 },
|
||||
:intvector{ 0,1,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6 },
|
||||
:bin{ 3f40411B2E411B4E641b244226411b284a7e421b2842 },
|
||||
: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}, "", "?", ""
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user