]> granicus.if.org Git - icu/commitdiff
ICU-11869 Update 2022 code in ICU4C
authorMichael Ow <mow@svn.icu-project.org>
Wed, 23 Sep 2015 20:49:25 +0000 (20:49 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Wed, 23 Sep 2015 20:49:25 +0000 (20:49 +0000)
X-SVN-Rev: 38014

icu4c/source/common/ucnv2022.cpp
icu4c/source/test/testdata/conversion.txt

index c27e6226e244ca0edf20e033d2a3987248682cd6..0c12dd0d7ba3dc2c144ac19e31b1bd4dc90c0c89 100644 (file)
@@ -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);
                     }
                 }
             }
index f3183bca62bdd66d78ebd586fe551c8d028a9f6b..0e3c8f4724bb309f417f8192f7c1c53e5954031d 100644 (file)
@@ -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}, "", "?", ""
         }