From eef7281848bcea908de1072c580395e7f7d7d3c9 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Wed, 23 Sep 2015 05:22:40 +0000 Subject: [PATCH] ICU-11869 Add fix to JIS8 and other ISO2022JP X-SVN-Rev: 38002 --- icu4c/source/common/ucnv2022.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/icu4c/source/common/ucnv2022.cpp b/icu4c/source/common/ucnv2022.cpp index e169d89df61..c27e6226e24 100644 --- a/icu4c/source/common/ucnv2022.cpp +++ b/icu4c/source/common/ucnv2022.cpp @@ -1429,8 +1429,8 @@ static const StateEnum jpCharsetPref[]={ HWKANA_7BIT }; -/* preference order of JP charsets for version 4*/ -static const StateEnum jpCharsetPref_ver4[]={ +/* alternate preference order of JP charsets for version 2,3,4*/ +static const StateEnum jpCharsetPref_alt[]={ ASCII, JISX201, ISO8859_1, @@ -1771,11 +1771,11 @@ getTrail: } /* - * version 4 of JP iso 2022 requires a different preference order for the 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 */ - if (converterData->version == 4) { - for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref_ver4); ++i) { - cs = (int8_t)jpCharsetPref_ver4[i]; + 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); -- 2.40.0