8213618: IBM970 charset has missing entry and remove unexpected entries
authoritakiguchi
Sun, 02 Dec 2018 11:09:46 -0800
changeset 52792 bc1fadfd2396
parent 52791 a6ede2dabe20
child 52793 df065f8356d7
8213618: IBM970 charset has missing entry and remove unexpected entries Reviewed-by: srl, martin
make/data/charsetmapping/IBM970.c2b
make/data/charsetmapping/IBM970.map
test/jdk/sun/nio/cs/TestIBMBugs.java
--- a/make/data/charsetmapping/IBM970.c2b	Sat Dec 01 21:58:05 2018 +0800
+++ b/make/data/charsetmapping/IBM970.c2b	Sun Dec 02 11:09:46 2018 -0800
@@ -5,14 +5,3 @@
 A2A6       FF5E
 A2C1       2299
 A3DC       20A9
-#
-# see .map file for the info regarding following 3 entries
-#
-a1aa	6950
-a1a9	84f1
-a1ad	cf7f
-
-
-
-
-
--- a/make/data/charsetmapping/IBM970.map	Sat Dec 01 21:58:05 2018 +0800
+++ b/make/data/charsetmapping/IBM970.map	Sun Dec 02 11:09:46 2018 -0800
@@ -1,15 +1,6 @@
 #
 #    source: Cp970.b2c, which is identical(?) to 03CA34B0.TPMAP100
 #
-#    Warning:
-#        following 3 c->b only entries exist in the "old" implementation,
-#        they don't appear existing in any of of the cdc 970 tables. Added
-#        them into c2b for "compatibility
-#        6950  ->  a1aa    2014
-#        84f1  ->  a1a9    2010
-#        cf7f  ->  a1ad    301c
-#
-#
 00         0000			
 01         0001			
 02         0002			
@@ -294,6 +285,7 @@
 A2BE       2665			
 A2BF       2667			
 A2C0       2663			
+A2C1       25C9			
 A2C2       25C8			
 A2C3       25A3			
 A2C4       25D0			
--- a/test/jdk/sun/nio/cs/TestIBMBugs.java	Sat Dec 01 21:58:05 2018 +0800
+++ b/test/jdk/sun/nio/cs/TestIBMBugs.java	Sun Dec 02 11:09:46 2018 -0800
@@ -174,6 +174,19 @@
         }
     }
 
+    private static void bug8213618 () throws Exception {
+        String cs = "x-IBM970";
+        byte[] ba = new byte[]{(byte)0xA2,(byte)0xC1};
+        String s = "\u25C9";
+        if (!(new String(ba, cs)).equals(s))
+            throw new Exception("Cp970 failed");
+        if (!Arrays.equals(ba, s.getBytes(cs)))
+            throw new Exception("Cp970 failed");
+        ba = new byte[]{0x3f,0x3f,0x3f};
+        if (!Arrays.equals(ba, "\u6950\u84f1\ucf7f".getBytes(cs)))
+            throw new Exception("Cp970 failed");
+    }
+
     private static void bug8202329() throws Exception {
         String original = "\\\u007E\u00A5\u203E"; // [backslash][tilde][yen][overscore]
         byte[] expectedBytes; // bytes after conversion
@@ -232,5 +245,6 @@
         bug6371431();
         bug6569191();
         bug8202329();
+        bug8213618();
     }
 }