8186751: Add ISO-8859-16 Charset support
authorsherman
Fri, 01 Sep 2017 08:15:52 -0700
changeset 47115 5e68e293e7a1
parent 47114 5a9e5cc0be89
child 47116 6160b308ed24
8186751: Add ISO-8859-16 Charset support Reviewed-by: alanb
jdk/make/data/charsetmapping/ISO_8859_16.map
jdk/make/data/charsetmapping/charsets
jdk/src/java.base/share/classes/sun/nio/cs/Unicode.java
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template
jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java
jdk/test/java/nio/charset/Charset/RegisteredCharsets.java
jdk/test/sun/nio/cs/TestCharsetMapping.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/data/charsetmapping/ISO_8859_16.map	Fri Sep 01 08:15:52 2017 -0700
@@ -0,0 +1,258 @@
+# Confirmed with the mapping at
+# http://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT
+0x00    U+0000
+0x01    U+0001
+0x02    U+0002
+0x03    U+0003
+0x04    U+0004
+0x05    U+0005
+0x06    U+0006
+0x07    U+0007
+0x08    U+0008
+0x09    U+0009
+0x0A    U+000A
+0x0B    U+000B
+0x0C    U+000C
+0x0D    U+000D
+0x0E    U+000E
+0x0F    U+000F
+0x10    U+0010
+0x11    U+0011
+0x12    U+0012
+0x13    U+0013
+0x14    U+0014
+0x15    U+0015
+0x16    U+0016
+0x17    U+0017
+0x18    U+0018
+0x19    U+0019
+0x1A    U+001A
+0x1B    U+001B
+0x1C    U+001C
+0x1D    U+001D
+0x1E    U+001E
+0x1F    U+001F
+0x20    U+0020
+0x21    U+0021
+0x22    U+0022
+0x23    U+0023
+0x24    U+0024
+0x25    U+0025
+0x26    U+0026
+0x27    U+0027
+0x28    U+0028
+0x29    U+0029
+0x2A    U+002A
+0x2B    U+002B
+0x2C    U+002C
+0x2D    U+002D
+0x2E    U+002E
+0x2F    U+002F
+0x30    U+0030
+0x31    U+0031
+0x32    U+0032
+0x33    U+0033
+0x34    U+0034
+0x35    U+0035
+0x36    U+0036
+0x37    U+0037
+0x38    U+0038
+0x39    U+0039
+0x3A    U+003A
+0x3B    U+003B
+0x3C    U+003C
+0x3D    U+003D
+0x3E    U+003E
+0x3F    U+003F
+0x40    U+0040
+0x41    U+0041
+0x42    U+0042
+0x43    U+0043
+0x44    U+0044
+0x45    U+0045
+0x46    U+0046
+0x47    U+0047
+0x48    U+0048
+0x49    U+0049
+0x4A    U+004A
+0x4B    U+004B
+0x4C    U+004C
+0x4D    U+004D
+0x4E    U+004E
+0x4F    U+004F
+0x50    U+0050
+0x51    U+0051
+0x52    U+0052
+0x53    U+0053
+0x54    U+0054
+0x55    U+0055
+0x56    U+0056
+0x57    U+0057
+0x58    U+0058
+0x59    U+0059
+0x5A    U+005A
+0x5B    U+005B
+0x5C    U+005C
+0x5D    U+005D
+0x5E    U+005E
+0x5F    U+005F
+0x60    U+0060
+0x61    U+0061
+0x62    U+0062
+0x63    U+0063
+0x64    U+0064
+0x65    U+0065
+0x66    U+0066
+0x67    U+0067
+0x68    U+0068
+0x69    U+0069
+0x6A    U+006A
+0x6B    U+006B
+0x6C    U+006C
+0x6D    U+006D
+0x6E    U+006E
+0x6F    U+006F
+0x70    U+0070
+0x71    U+0071
+0x72    U+0072
+0x73    U+0073
+0x74    U+0074
+0x75    U+0075
+0x76    U+0076
+0x77    U+0077
+0x78    U+0078
+0x79    U+0079
+0x7A    U+007A
+0x7B    U+007B
+0x7C    U+007C
+0x7D    U+007D
+0x7E    U+007E
+0x7F    U+007F
+0x80    U+0080
+0x81    U+0081
+0x82    U+0082
+0x83    U+0083
+0x84    U+0084
+0x85    U+0085
+0x86    U+0086
+0x87    U+0087
+0x88    U+0088
+0x89    U+0089
+0x8A    U+008A
+0x8B    U+008B
+0x8C    U+008C
+0x8D    U+008D
+0x8E    U+008E
+0x8F    U+008F
+0x90    U+0090
+0x91    U+0091
+0x92    U+0092
+0x93    U+0093
+0x94    U+0094
+0x95    U+0095
+0x96    U+0096
+0x97    U+0097
+0x98    U+0098
+0x99    U+0099
+0x9A    U+009A
+0x9B    U+009B
+0x9C    U+009C
+0x9D    U+009D
+0x9E    U+009E
+0x9F    U+009F
+0xA0    U+00A0
+0xA1    U+0104
+0xA2    U+0105
+0xA3    U+0141
+0xA4    U+20AC
+0xA5    U+201E
+0xA6    U+0160
+0xA7    U+00A7
+0xA8    U+0161
+0xA9    U+00A9
+0xAA    U+0218
+0xAB    U+00AB
+0xAC    U+0179
+0xAD    U+00AD
+0xAE    U+017A
+0xAF    U+017B
+0xB0    U+00B0
+0xB1    U+00B1
+0xB2    U+010C
+0xB3    U+0142
+0xB4    U+017D
+0xB5    U+201D
+0xB6    U+00B6
+0xB7    U+00B7
+0xB8    U+017E
+0xB9    U+010D
+0xBA    U+0219
+0xBB    U+00BB
+0xBC    U+0152
+0xBD    U+0153
+0xBE    U+0178
+0xBF    U+017C
+0xC0    U+00C0
+0xC1    U+00C1
+0xC2    U+00C2
+0xC3    U+0102
+0xC4    U+00C4
+0xC5    U+0106
+0xC6    U+00C6
+0xC7    U+00C7
+0xC8    U+00C8
+0xC9    U+00C9
+0xCA    U+00CA
+0xCB    U+00CB
+0xCC    U+00CC
+0xCD    U+00CD
+0xCE    U+00CE
+0xCF    U+00CF
+0xD0    U+0110
+0xD1    U+0143
+0xD2    U+00D2
+0xD3    U+00D3
+0xD4    U+00D4
+0xD5    U+0150
+0xD6    U+00D6
+0xD7    U+015A
+0xD8    U+0170
+0xD9    U+00D9
+0xDA    U+00DA
+0xDB    U+00DB
+0xDC    U+00DC
+0xDD    U+0118
+0xDE    U+021A
+0xDF    U+00DF
+0xE0    U+00E0
+0xE1    U+00E1
+0xE2    U+00E2
+0xE3    U+0103
+0xE4    U+00E4
+0xE5    U+0107
+0xE6    U+00E6
+0xE7    U+00E7
+0xE8    U+00E8
+0xE9    U+00E9
+0xEA    U+00EA
+0xEB    U+00EB
+0xEC    U+00EC
+0xED    U+00ED
+0xEE    U+00EE
+0xEF    U+00EF
+0xF0    U+0111
+0xF1    U+0144
+0xF2    U+00F2
+0xF3    U+00F3
+0xF4    U+00F4
+0xF5    U+0151
+0xF6    U+00F6
+0xF7    U+015B
+0xF8    U+0171
+0xF9    U+00F9
+0xFA    U+00FA
+0xFB    U+00FB
+0xFC    U+00FC
+0xFD    U+0119
+0xFE    U+021B
+0xFF    U+00FF
--- a/jdk/make/data/charsetmapping/charsets	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/make/data/charsetmapping/charsets	Fri Sep 01 08:15:52 2017 -0700
@@ -257,6 +257,8 @@
     hisname ISO8859_15
     ascii   true
     alias   ISO_8859-15                # IANA alias
+    alias   Latin-9
+    alias   csISO885915
     alias   8859_15                    # Other aliases
     alias   ISO-8859-15
     alias   ISO8859_15
@@ -272,6 +274,18 @@
     alias   csISOlatin9
     alias   ISO8859_15_FDIS
 
+charset ISO-8859-16 ISO_8859_16
+    package sun.nio.cs
+    type    sbcs
+    hisname ISO8859_16
+    ascii   true
+    alias   iso-ir-226
+    alias   ISO_8859-16:2001
+    alias   ISO_8859-16
+    alias   latin10
+    alias   l10
+    alias   csISO885916
+
 charset KOI8-R KOI8_R
     package sun.nio.cs
     type    sbcs
--- a/jdk/src/java.base/share/classes/sun/nio/cs/Unicode.java	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/Unicode.java	Fri Sep 01 08:15:52 2017 -0700
@@ -38,6 +38,7 @@
         return ((cs instanceof US_ASCII)
                 || (cs instanceof ISO_8859_1)
                 || (cs instanceof ISO_8859_15)
+                || (cs instanceof ISO_8859_16)
                 || (cs instanceof MS1252)
                 || (cs instanceof UTF_8)
                 || (cs instanceof UTF_16)
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java.template	Fri Sep 01 08:15:52 2017 -0700
@@ -60,11 +60,12 @@
                 || (cs.name().equals("ISO-8859-8"))
                 || (cs.name().equals("ISO-8859-9"))
                 || (cs.name().equals("ISO-8859-13"))
+                || (cs.name().equals("ISO-8859-15"))
+                || (cs.name().equals("ISO-8859-16"))
                 || (cs.name().equals("UTF-8"))
                 || (cs.name().equals("UTF-16"))
                 || (cs.name().equals("UTF-16LE"))
                 || (cs.name().equals("UTF-16BE"))
-                || (cs.name().equals("ISO-8859-15"))
                 || (cs.name().equals("windows-1251"))
                 || (cs.name().equals("windows-1252"))
                 || (cs.name().equals("windows-1253"))
--- a/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java	Fri Sep 01 08:15:52 2017 -0700
@@ -32,9 +32,9 @@
 public class CharsetContainmentTest {
     static String[] encodings =
         { "US-ASCII", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-8",
-          "windows-1252", "ISO-8859-1", "ISO-8859-15", "ISO-8859-2",
-          "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6",
-          "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-13",
+          "windows-1252", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3",
+          "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7",
+          "ISO-8859-8", "ISO-8859-9", "ISO-8859-13", "ISO-8859-15", "ISO-8859-16",
           "ISO-2022-JP", "ISO-2022-KR",
 
           // Temporarily remove ISO-2022-CN-* charsets until full encoder/decoder
@@ -57,7 +57,6 @@
            encodings,
           {"US-ASCII", "windows-1252"},
           {"US-ASCII", "ISO-8859-1"},
-          {"US-ASCII", "ISO-8859-15"},
           {"US-ASCII", "ISO-8859-2"},
           {"US-ASCII", "ISO-8859-3"},
           {"US-ASCII", "ISO-8859-4"},
@@ -67,6 +66,8 @@
           {"US-ASCII", "ISO-8859-8"},
           {"US-ASCII", "ISO-8859-9"},
           {"US-ASCII", "ISO-8859-13"},
+          {"US-ASCII", "ISO-8859-15"},
+          {"US-ASCII", "ISO-8859-16"},
           {"ISO-2022-JP"},
           {"ISO-2022-KR"},
           // Temporarily remove ISO-2022-CN-* charsets until full encoder/decoder
--- a/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java	Fri Sep 01 08:15:52 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /* @test
  * @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668
-        6911753 8071447
+        6911753 8071447 8186751
  * @summary Check that registered charsets are actually registered
  * @modules jdk.charsets
  */
@@ -42,7 +42,8 @@
                             "ISO-8859-1", "ISO-8859-2", "ISO-8859-3",
                             "ISO-8859-4", "ISO-8859-5", "ISO-8859-6",
                             "ISO-8859-7", "ISO-8859-8", "ISO-8859-9",
-                            "ISO-8859-13", "ISO-8859-15", "windows-1251",
+                            "ISO-8859-13", "ISO-8859-15", "ISO-8859-16",
+                            "windows-1251",
                             "windows-1252", "windows-1253", "windows-1254",
                             "windows-1255", "windows-1256", "windows-31j",
                             "Shift_JIS", "JIS_X0201", "JIS_X0212-1990",
@@ -416,6 +417,8 @@
                 new String[] {
                     // IANA alias
                     "ISO_8859-15",
+                    "Latin-9",
+                    "csISO885915",
                     // JDK historical aliases
                     "8859_15",
                     "ISO-8859-15",
@@ -432,8 +435,17 @@
                     "csISOlatin0",
                     "csISOlatin9",
                     "ISO8859_15_FDIS"
+                });
 
-                });
+        aliasCheck("ISO-8859-16",
+                new String[] {
+                    "iso-ir-226",
+                    "ISO_8859-16:2001",
+                    "ISO_8859-16",
+                    "latin10",
+                    "l10",
+                    "csISO885916"
+                   });
 
         aliasCheck("JIS_X0212-1990",
                 new String[] {
--- a/jdk/test/sun/nio/cs/TestCharsetMapping.java	Fri Sep 01 14:15:37 2017 +0000
+++ b/jdk/test/sun/nio/cs/TestCharsetMapping.java	Fri Sep 01 08:15:52 2017 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 8186801
+ * @bug 8186801 8186751
  * @summary Test the charset mappings
  */