Xueming Shen | b09ac3b | 2010-01-27 19:39:55 -0800 | [diff] [blame] | 1 | /* |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 2 | * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
Xueming Shen | b09ac3b | 2010-01-27 19:39:55 -0800 | [diff] [blame] | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | * version 2 for more details (a copy is included in the LICENSE file that |
| 13 | * accompanied this code). |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License version |
| 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 20 | * or visit www.oracle.com if you need additional information or have any |
| 21 | * questions. |
Xueming Shen | b09ac3b | 2010-01-27 19:39:55 -0800 | [diff] [blame] | 22 | */ |
| 23 | |
| 24 | /* @test |
Felix Yang | 61c3a29 | 2017-03-08 17:17:41 -0800 | [diff] [blame] | 25 | * @bug 4454622 |
| 26 | * @summary Check if all supported sun.io encoding names are supported in nio.charset |
| 27 | * @modules jdk.charsets |
Xueming Shen | b09ac3b | 2010-01-27 19:39:55 -0800 | [diff] [blame] | 28 | */ |
| 29 | |
| 30 | import java.util.HashMap; |
| 31 | import java.util.Set; |
| 32 | import java.io.UnsupportedEncodingException; |
| 33 | import java.nio.charset.*; |
| 34 | |
| 35 | public class SunioAlias { |
| 36 | public static void main(String argv[]) throws UnsupportedEncodingException { |
| 37 | Set<String> keys = aliasTable.keySet(); |
| 38 | String s = "testing string"; |
| 39 | boolean failed = false; |
| 40 | for (String alias : keys) { |
| 41 | /* See if StringCoding works correctly without sun.io package */ |
| 42 | try { |
| 43 | byte[] bs= s.getBytes(alias); |
| 44 | new String(bs, alias); |
| 45 | |
| 46 | Charset csAlias = Charset.forName(alias); |
| 47 | Charset csName = Charset.forName(aliasTable.get(alias)); |
| 48 | if (csName != csAlias) { |
| 49 | System.out.printf("Alias %s and %s is NOT the same charset in nio\n", |
| 50 | alias, aliasTable.get(alias)); |
| 51 | } |
| 52 | } catch (UnsupportedEncodingException e) { |
| 53 | System.out.printf("Alias %s is UnsupportedEncoding\n", alias); |
| 54 | failed = true; |
| 55 | } catch (IllegalCharsetNameException e) { |
| 56 | System.out.printf("Alias %s is IllegalCharsetName\n", alias); |
| 57 | failed = true; |
| 58 | } |
| 59 | } |
| 60 | if (failed) |
| 61 | throw new UnsupportedEncodingException ("sun.io encoding names are not supported in nio.charset!"); |
| 62 | } |
| 63 | //aliasTable is copy/pasted from sun.io.CharacterEncoding.java |
| 64 | |
| 65 | private static HashMap<String, String> aliasTable; |
| 66 | static { |
| 67 | aliasTable = new HashMap<String, String>(460, 1.0f); |
| 68 | |
| 69 | /* known failed names... TBD |
| 70 | // JIS-defined Shift JIS |
| 71 | aliasTable.put("\u30b7\u30d5\u30c8\u7b26\u53f7\u5316\u8868\u73fe", |
| 72 | "SJIS"); |
| 73 | // Specialized auto-detection for Japanese charsets |
| 74 | aliasTable.put("jis auto detect", "JISAutoDetect"); |
| 75 | // MIBenum: 1010 |
| 76 | aliasTable.put("unicode-1-1", "UnicodeBigUnmarked"); |
| 77 | */ |
| 78 | aliasTable.put("unicode", "UTF-16"); |
| 79 | aliasTable.put("cspc862latinhebrew", "Cp862"); |
| 80 | aliasTable.put("cp-is", "Cp861"); |
| 81 | /* |
| 82 | // X11 Compound Text |
| 83 | aliasTable.put("x-compound-text", "COMPOUND_TEXT"); |
| 84 | aliasTable.put("x11-compound_text", "COMPOUND_TEXT"); |
| 85 | */ |
| 86 | aliasTable.put("us-ascii", "ASCII"); |
| 87 | aliasTable.put("ascii", "ASCII"); |
| 88 | aliasTable.put("646", "ASCII"); // Solaris POSIX locale |
| 89 | aliasTable.put("iso_646.irv:1983", "ASCII"); // Linux POSIX locale |
| 90 | aliasTable.put("ansi_x3.4-1968", "ASCII"); // Caldera linux |
| 91 | aliasTable.put("iso646-us", "ASCII"); |
| 92 | aliasTable.put("default", "ASCII"); // compatibility with obsolete "Default" converters |
| 93 | aliasTable.put("ascii7", "ASCII"); // compatibility with obsolete "Default" converters |
| 94 | |
| 95 | // Core encodings |
| 96 | aliasTable.put("8859_1", "ISO8859_1"); |
| 97 | aliasTable.put("iso8859_1", "ISO8859_1"); |
| 98 | aliasTable.put("utf-8", "UTF8"); |
| 99 | aliasTable.put("utf8", "UTF8"); |
| 100 | aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); |
| 101 | |
| 102 | // Standard encodings used on Solaris and Linux |
| 103 | aliasTable.put("iso8859-1", "ISO8859_1"); |
| 104 | aliasTable.put("iso8859-2", "ISO8859_2"); |
| 105 | aliasTable.put("iso8859-4", "ISO8859_4"); |
| 106 | aliasTable.put("iso8859-5", "ISO8859_5"); |
| 107 | aliasTable.put("iso8859-6", "ISO8859_6"); |
| 108 | aliasTable.put("iso8859-8", "ISO8859_8"); |
| 109 | aliasTable.put("iso8859-9", "ISO8859_9"); |
| 110 | aliasTable.put("iso8859-13", "ISO8859_13"); |
| 111 | aliasTable.put("iso8859-15", "ISO8859_15"); |
| 112 | aliasTable.put("5601", "EUC_KR"); |
| 113 | aliasTable.put("ansi-1251", "Cp1251"); |
| 114 | aliasTable.put("big5", "Big5"); |
| 115 | aliasTable.put("big5hk", "Big5_HKSCS"); |
| 116 | aliasTable.put("eucjp", "EUC_JP"); |
| 117 | aliasTable.put("cns11643", "EUC_TW"); |
| 118 | aliasTable.put("gb2312", "EUC_CN"); |
| 119 | aliasTable.put("gb18030", "GB18030"); |
| 120 | aliasTable.put("gbk", "GBK"); |
| 121 | aliasTable.put("koi8-r", "KOI8_R"); |
| 122 | aliasTable.put("tis620.2533", "TIS620"); |
| 123 | |
| 124 | // Windows encodings |
| 125 | aliasTable.put("cp1250", "Cp1250"); |
| 126 | aliasTable.put("cp1251", "Cp1251"); |
| 127 | aliasTable.put("cp1252", "Cp1252"); |
| 128 | aliasTable.put("cp1253", "Cp1253"); |
| 129 | aliasTable.put("cp1254", "Cp1254"); |
| 130 | aliasTable.put("cp1255", "Cp1255"); |
| 131 | aliasTable.put("cp1256", "Cp1256"); |
| 132 | aliasTable.put("cp1257", "Cp1257"); |
| 133 | aliasTable.put("cp1258", "Cp1258"); |
| 134 | aliasTable.put("ms874", "MS874"); |
| 135 | aliasTable.put("ms932", "MS932"); |
| 136 | aliasTable.put("ms949", "MS949"); |
| 137 | aliasTable.put("ms950", "MS950"); |
| 138 | aliasTable.put("ms1361", "MS1361"); |
| 139 | |
| 140 | // MIBenum: 4 |
| 141 | aliasTable.put("8859_1", "ISO8859_1"); |
| 142 | aliasTable.put("iso_8859-1:1987", "ISO8859_1"); |
| 143 | aliasTable.put("iso-ir-100", "ISO8859_1"); |
| 144 | aliasTable.put("iso_8859-1", "ISO8859_1"); |
| 145 | aliasTable.put("iso-8859-1", "ISO8859_1"); |
| 146 | aliasTable.put("iso8859-1", "ISO8859_1"); |
| 147 | aliasTable.put("latin1", "ISO8859_1"); |
| 148 | aliasTable.put("l1", "ISO8859_1"); |
| 149 | aliasTable.put("ibm819", "ISO8859_1"); |
| 150 | aliasTable.put("ibm-819", "ISO8859_1"); |
| 151 | aliasTable.put("cp819", "ISO8859_1"); |
| 152 | aliasTable.put("819", "ISO8859_1"); |
| 153 | aliasTable.put("csisolatin1", "ISO8859_1"); |
| 154 | |
| 155 | // MIBenum: 5 |
| 156 | aliasTable.put("8859_2", "ISO8859_2"); |
| 157 | aliasTable.put("iso_8859-2:1987", "ISO8859_2"); |
| 158 | aliasTable.put("iso-ir-101", "ISO8859_2"); |
| 159 | aliasTable.put("iso_8859-2", "ISO8859_2"); |
| 160 | aliasTable.put("iso-8859-2", "ISO8859_2"); |
| 161 | aliasTable.put("iso8859-2", "ISO8859_2"); |
| 162 | aliasTable.put("latin2", "ISO8859_2"); |
| 163 | aliasTable.put("l2", "ISO8859_2"); |
| 164 | aliasTable.put("ibm912", "ISO8859_2"); |
| 165 | aliasTable.put("ibm-912", "ISO8859_2"); |
| 166 | aliasTable.put("cp912", "ISO8859_2"); |
| 167 | aliasTable.put("912", "ISO8859_2"); |
| 168 | aliasTable.put("csisolatin2", "ISO8859_2"); |
| 169 | |
| 170 | // MIBenum: 6 |
| 171 | aliasTable.put("8859_3", "ISO8859_3"); |
| 172 | aliasTable.put("iso_8859-3:1988", "ISO8859_3"); |
| 173 | aliasTable.put("iso-ir-109", "ISO8859_3"); |
| 174 | aliasTable.put("iso_8859-3", "ISO8859_3"); |
| 175 | aliasTable.put("iso-8859-3", "ISO8859_3"); |
| 176 | aliasTable.put("iso8859-3", "ISO8859_3"); |
| 177 | aliasTable.put("latin3", "ISO8859_3"); |
| 178 | aliasTable.put("l3", "ISO8859_3"); |
| 179 | aliasTable.put("ibm913", "ISO8859_3"); |
| 180 | aliasTable.put("ibm-913", "ISO8859_3"); |
| 181 | aliasTable.put("cp913", "ISO8859_3"); |
| 182 | aliasTable.put("913", "ISO8859_3"); |
| 183 | aliasTable.put("csisolatin3", "ISO8859_3"); |
| 184 | |
| 185 | // MIBenum: 7 |
| 186 | aliasTable.put("8859_4", "ISO8859_4"); |
| 187 | aliasTable.put("iso_8859-4:1988", "ISO8859_4"); |
| 188 | aliasTable.put("iso-ir-110", "ISO8859_4"); |
| 189 | aliasTable.put("iso_8859-4", "ISO8859_4"); |
| 190 | aliasTable.put("iso-8859-4", "ISO8859_4"); |
| 191 | aliasTable.put("iso8859-4", "ISO8859_4"); |
| 192 | aliasTable.put("latin4", "ISO8859_4"); |
| 193 | aliasTable.put("l4", "ISO8859_4"); |
| 194 | aliasTable.put("ibm914", "ISO8859_4"); |
| 195 | aliasTable.put("ibm-914", "ISO8859_4"); |
| 196 | aliasTable.put("cp914", "ISO8859_4"); |
| 197 | aliasTable.put("914", "ISO8859_4"); |
| 198 | aliasTable.put("csisolatin4", "ISO8859_4"); |
| 199 | |
| 200 | // MIBenum: 8 |
| 201 | aliasTable.put("8859_5", "ISO8859_5"); |
| 202 | aliasTable.put("iso_8859-5:1988", "ISO8859_5"); |
| 203 | aliasTable.put("iso-ir-144", "ISO8859_5"); |
| 204 | aliasTable.put("iso_8859-5", "ISO8859_5"); |
| 205 | aliasTable.put("iso-8859-5", "ISO8859_5"); |
| 206 | aliasTable.put("iso8859-5", "ISO8859_5"); |
| 207 | aliasTable.put("cyrillic", "ISO8859_5"); |
| 208 | aliasTable.put("csisolatincyrillic", "ISO8859_5"); |
| 209 | aliasTable.put("ibm915", "ISO8859_5"); |
| 210 | aliasTable.put("ibm-915", "ISO8859_5"); |
| 211 | aliasTable.put("cp915", "ISO8859_5"); |
| 212 | aliasTable.put("915", "ISO8859_5"); |
| 213 | |
| 214 | // MIBenum: 9 |
| 215 | aliasTable.put("8859_6", "ISO8859_6"); |
| 216 | aliasTable.put("iso_8859-6:1987", "ISO8859_6"); |
| 217 | aliasTable.put("iso-ir-127", "ISO8859_6"); |
| 218 | aliasTable.put("iso_8859-6", "ISO8859_6"); |
| 219 | aliasTable.put("iso-8859-6", "ISO8859_6"); |
| 220 | aliasTable.put("iso8859-6", "ISO8859_6"); |
| 221 | aliasTable.put("ecma-114", "ISO8859_6"); |
| 222 | aliasTable.put("asmo-708", "ISO8859_6"); |
| 223 | aliasTable.put("arabic", "ISO8859_6"); |
| 224 | aliasTable.put("csisolatinarabic", "ISO8859_6"); |
| 225 | aliasTable.put("ibm1089", "ISO8859_6"); |
| 226 | aliasTable.put("ibm-1089", "ISO8859_6"); |
| 227 | aliasTable.put("cp1089", "ISO8859_6"); |
| 228 | aliasTable.put("1089", "ISO8859_6"); |
| 229 | |
| 230 | // MIBenum: 10 |
| 231 | aliasTable.put("8859_7", "ISO8859_7"); |
| 232 | aliasTable.put("iso_8859-7:1987", "ISO8859_7"); |
| 233 | aliasTable.put("iso-ir-126", "ISO8859_7"); |
| 234 | aliasTable.put("iso_8859-7", "ISO8859_7"); |
| 235 | aliasTable.put("iso-8859-7", "ISO8859_7"); |
| 236 | aliasTable.put("iso8859-7", "ISO8859_7"); |
| 237 | aliasTable.put("elot_928", "ISO8859_7"); |
| 238 | aliasTable.put("ecma-118", "ISO8859_7"); |
| 239 | aliasTable.put("greek", "ISO8859_7"); |
| 240 | aliasTable.put("greek8", "ISO8859_7"); |
| 241 | aliasTable.put("csisolatingreek", "ISO8859_7"); |
| 242 | aliasTable.put("ibm813", "ISO8859_7"); |
| 243 | aliasTable.put("ibm-813", "ISO8859_7"); |
| 244 | aliasTable.put("cp813", "ISO8859_7"); |
| 245 | aliasTable.put("813", "ISO8859_7"); |
| 246 | aliasTable.put("sun_eu_greek", "ISO8859_7"); |
| 247 | |
| 248 | // MIBenum: 11 |
| 249 | aliasTable.put("8859_8", "ISO8859_8"); |
| 250 | aliasTable.put("iso_8859-8:1988", "ISO8859_8"); |
| 251 | aliasTable.put("iso-ir-138", "ISO8859_8"); |
| 252 | aliasTable.put("iso_8859-8", "ISO8859_8"); |
| 253 | aliasTable.put("iso-8859-8", "ISO8859_8"); |
| 254 | aliasTable.put("iso8859-8", "ISO8859_8"); |
| 255 | aliasTable.put("hebrew", "ISO8859_8"); |
| 256 | aliasTable.put("csisolatinhebrew", "ISO8859_8"); |
| 257 | aliasTable.put("ibm916", "ISO8859_8"); |
| 258 | aliasTable.put("ibm-916", "ISO8859_8"); |
| 259 | aliasTable.put("cp916", "ISO8859_8"); |
| 260 | aliasTable.put("916", "ISO8859_8"); |
| 261 | |
| 262 | // MIBenum: 12 |
| 263 | aliasTable.put("8859_9", "ISO8859_9"); |
| 264 | aliasTable.put("iso-ir-148", "ISO8859_9"); |
| 265 | aliasTable.put("iso_8859-9", "ISO8859_9"); |
| 266 | aliasTable.put("iso-8859-9", "ISO8859_9"); |
| 267 | aliasTable.put("iso8859-9", "ISO8859_9"); |
| 268 | aliasTable.put("latin5", "ISO8859_9"); |
| 269 | aliasTable.put("l5", "ISO8859_9"); |
| 270 | aliasTable.put("ibm920", "ISO8859_9"); |
| 271 | aliasTable.put("ibm-920", "ISO8859_9"); |
| 272 | aliasTable.put("cp920", "ISO8859_9"); |
| 273 | aliasTable.put("920", "ISO8859_9"); |
| 274 | aliasTable.put("csisolatin5", "ISO8859_9"); |
| 275 | |
| 276 | // MIBenum: ??? |
| 277 | aliasTable.put("8859_13", "ISO8859_13"); |
| 278 | aliasTable.put("iso_8859-13", "ISO8859_13"); |
| 279 | aliasTable.put("iso-8859-13", "ISO8859_13"); |
| 280 | aliasTable.put("iso8859-13", "ISO8859_13"); |
| 281 | |
| 282 | |
| 283 | // MIBenum: ???? |
| 284 | aliasTable.put("8859_15", "ISO8859_15"); |
| 285 | aliasTable.put("iso-8859-15", "ISO8859_15"); |
| 286 | aliasTable.put("iso_8859-15", "ISO8859_15"); |
| 287 | aliasTable.put("iso8859-15", "ISO8859_15"); |
| 288 | aliasTable.put("ibm923", "ISO8859_15"); |
| 289 | aliasTable.put("ibm-923", "ISO8859_15"); |
| 290 | aliasTable.put("cp923", "ISO8859_15"); |
| 291 | aliasTable.put("923", "ISO8859_15"); |
| 292 | aliasTable.put("latin0", "ISO8859_15"); |
| 293 | aliasTable.put("latin9", "ISO8859_15"); |
| 294 | aliasTable.put("csisolatin0", "ISO8859_15"); |
| 295 | aliasTable.put("csisolatin9", "ISO8859_15"); |
| 296 | |
| 297 | //For compatibility purpose |
| 298 | aliasTable.put("iso8859_15_fdis", "ISO8859_15"); |
| 299 | |
| 300 | // MIBenum: 106 |
| 301 | aliasTable.put("utf-8", "UTF8"); |
| 302 | |
| 303 | // Alias recommended in RFC 1641 |
| 304 | aliasTable.put("unicode-1-1-utf-8", "UTF8"); |
| 305 | |
| 306 | // MIBenum: 1000 |
| 307 | aliasTable.put("iso-10646-ucs-2", "UnicodeBigUnmarked"); |
| 308 | |
| 309 | // Per Unicode standard |
| 310 | aliasTable.put("utf-16be", "UnicodeBigUnmarked"); |
| 311 | aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); |
| 312 | aliasTable.put("utf-16", "UTF16"); |
| 313 | |
| 314 | // Used by drag-and-drop subsystem |
| 315 | aliasTable.put("x-utf-16be", "UnicodeBigUnmarked"); |
| 316 | aliasTable.put("x-utf-16le", "UnicodeLittleUnmarked"); |
| 317 | |
| 318 | // MIBenum: ???? |
| 319 | aliasTable.put("ibm037", "Cp037"); |
| 320 | aliasTable.put("ibm-037", "Cp037"); |
| 321 | aliasTable.put("cp037", "Cp037"); |
| 322 | aliasTable.put("037", "Cp037"); |
| 323 | |
| 324 | // MIBenum: ???? |
| 325 | aliasTable.put("ibm273", "Cp273"); |
| 326 | aliasTable.put("ibm-273", "Cp273"); |
| 327 | aliasTable.put("cp273", "Cp273"); |
| 328 | aliasTable.put("273", "Cp273"); |
| 329 | |
| 330 | // MIBenum: ???? |
| 331 | aliasTable.put("ibm277", "Cp277"); |
| 332 | aliasTable.put("ibm-277", "Cp277"); |
| 333 | aliasTable.put("cp277", "Cp277"); |
| 334 | aliasTable.put("277", "Cp277"); |
| 335 | |
| 336 | // MIBenum: ???? |
| 337 | aliasTable.put("ibm278", "Cp278"); |
| 338 | aliasTable.put("ibm-278", "Cp278"); |
| 339 | aliasTable.put("cp278", "Cp278"); |
| 340 | aliasTable.put("278", "Cp278"); |
| 341 | |
| 342 | // MIBenum: ???? |
| 343 | aliasTable.put("ibm280", "Cp280"); |
| 344 | aliasTable.put("ibm-280", "Cp280"); |
| 345 | aliasTable.put("cp280", "Cp280"); |
| 346 | aliasTable.put("280", "Cp280"); |
| 347 | |
| 348 | // MIBenum: ???? |
| 349 | aliasTable.put("ibm284", "Cp284"); |
| 350 | aliasTable.put("ibm-284", "Cp284"); |
| 351 | aliasTable.put("cp284", "Cp284"); |
| 352 | aliasTable.put("284", "Cp284"); |
| 353 | |
| 354 | // MIBenum: ???? |
| 355 | aliasTable.put("ibm285", "Cp285"); |
| 356 | aliasTable.put("ibm-285", "Cp285"); |
| 357 | aliasTable.put("cp285", "Cp285"); |
| 358 | aliasTable.put("285", "Cp285"); |
| 359 | |
| 360 | // MIBenum: ???? |
| 361 | aliasTable.put("ibm297", "Cp297"); |
| 362 | aliasTable.put("ibm-297", "Cp297"); |
| 363 | aliasTable.put("cp297", "Cp297"); |
| 364 | aliasTable.put("297", "Cp297"); |
| 365 | |
| 366 | // MIBenum: ???? |
| 367 | aliasTable.put("ibm420", "Cp420"); |
| 368 | aliasTable.put("ibm-420", "Cp420"); |
| 369 | aliasTable.put("cp420", "Cp420"); |
| 370 | aliasTable.put("420", "Cp420"); |
| 371 | |
| 372 | // MIBenum: ???? |
| 373 | aliasTable.put("ibm424", "Cp424"); |
| 374 | aliasTable.put("ibm-424", "Cp424"); |
| 375 | aliasTable.put("cp424", "Cp424"); |
| 376 | aliasTable.put("424", "Cp424"); |
| 377 | |
| 378 | // MIBenum: 2011 |
| 379 | aliasTable.put("ibm437", "Cp437"); |
| 380 | aliasTable.put("ibm-437", "Cp437"); |
| 381 | aliasTable.put("cp437", "Cp437"); |
| 382 | aliasTable.put("437", "Cp437"); |
| 383 | aliasTable.put("cspc8codepage437", "Cp437"); |
| 384 | |
| 385 | // MIBenum: ???? |
| 386 | aliasTable.put("ibm500", "Cp500"); |
| 387 | aliasTable.put("ibm-500", "Cp500"); |
| 388 | aliasTable.put("cp500", "Cp500"); |
| 389 | aliasTable.put("500", "Cp500"); |
| 390 | |
| 391 | // MIBenum: ???? |
| 392 | aliasTable.put("ibm737", "Cp737"); |
| 393 | aliasTable.put("ibm-737", "Cp737"); |
| 394 | aliasTable.put("cp737", "Cp737"); |
| 395 | aliasTable.put("737", "Cp737"); |
| 396 | |
| 397 | // MIBenum: ???? |
| 398 | aliasTable.put("ibm775", "Cp775"); |
| 399 | aliasTable.put("ibm-775", "Cp775"); |
| 400 | aliasTable.put("cp775", "Cp775"); |
| 401 | aliasTable.put("775", "Cp775"); |
| 402 | |
| 403 | // MIBenum: ???? |
| 404 | aliasTable.put("ibm838", "Cp838"); /* MDA */ |
| 405 | aliasTable.put("ibm-838", "Cp838"); /* MDA */ |
| 406 | aliasTable.put("cp838", "Cp838"); /* MDA */ |
| 407 | aliasTable.put("838", "Cp838"); /* MDA */ |
| 408 | |
| 409 | // "Cp850" |
| 410 | // MIBenum: 2009 |
| 411 | aliasTable.put("ibm850", "Cp850"); |
| 412 | aliasTable.put("ibm-850", "Cp850"); |
| 413 | aliasTable.put("cp850", "Cp850"); |
| 414 | aliasTable.put("850", "Cp850"); |
| 415 | aliasTable.put("cspc850multilingual", "Cp850"); |
| 416 | |
| 417 | // "Cp852" |
| 418 | // MIBenum: 2010 |
| 419 | aliasTable.put("ibm852", "Cp852"); |
| 420 | aliasTable.put("ibm-852", "Cp852"); |
| 421 | aliasTable.put("cp852", "Cp852"); |
| 422 | aliasTable.put("852", "Cp852"); |
| 423 | aliasTable.put("cspcp852", "Cp852"); |
| 424 | |
| 425 | // "Cp855" |
| 426 | // MIBenum: 2046 |
| 427 | aliasTable.put("ibm855", "Cp855"); |
| 428 | aliasTable.put("ibm-855", "Cp855"); |
| 429 | aliasTable.put("cp855", "Cp855"); |
| 430 | aliasTable.put("855", "Cp855"); |
| 431 | aliasTable.put("cspcp855", "Cp855"); |
| 432 | |
| 433 | // "Cp855" |
| 434 | // MIBenum: ??? |
| 435 | aliasTable.put("ibm856", "Cp856"); |
| 436 | aliasTable.put("ibm-856", "Cp856"); |
| 437 | aliasTable.put("cp856", "Cp856"); |
| 438 | aliasTable.put("856", "Cp856"); |
| 439 | |
| 440 | // "Cp857" |
| 441 | // MIBenum: 2047 |
| 442 | aliasTable.put("ibm857", "Cp857"); |
| 443 | aliasTable.put("ibm-857", "Cp857"); |
| 444 | aliasTable.put("cp857", "Cp857"); |
| 445 | aliasTable.put("857", "Cp857"); |
| 446 | aliasTable.put("csibm857", "Cp857"); |
| 447 | |
| 448 | // "Cp860" |
| 449 | // MIBenum: 2048 |
| 450 | aliasTable.put("ibm860", "Cp860"); |
| 451 | aliasTable.put("ibm-860", "Cp860"); |
| 452 | aliasTable.put("cp860", "Cp860"); |
| 453 | aliasTable.put("860", "Cp860"); |
| 454 | aliasTable.put("csibm860", "Cp860"); |
| 455 | |
| 456 | // MIBenum: 2049 |
| 457 | aliasTable.put("ibm861", "Cp861"); |
| 458 | aliasTable.put("ibm-861", "Cp861"); |
| 459 | aliasTable.put("cp861", "Cp861"); |
| 460 | aliasTable.put("861", "Cp861"); |
| 461 | aliasTable.put("csibm861", "Cp861"); |
| 462 | |
| 463 | // MIBenum: 2013 |
| 464 | aliasTable.put("ibm862", "Cp862"); |
| 465 | aliasTable.put("ibm-862", "Cp862"); |
| 466 | aliasTable.put("cp862", "Cp862"); |
| 467 | aliasTable.put("862", "Cp862"); |
| 468 | |
| 469 | // MIBenum: 2050 |
| 470 | aliasTable.put("ibm863", "Cp863"); |
| 471 | aliasTable.put("ibm-863", "Cp863"); |
| 472 | aliasTable.put("cp863", "Cp863"); |
| 473 | aliasTable.put("863", "Cp863"); |
| 474 | aliasTable.put("csibm863", "Cp863"); |
| 475 | |
| 476 | // MIBenum: 2051 |
| 477 | aliasTable.put("ibm864", "Cp864"); |
| 478 | aliasTable.put("ibm-864", "Cp864"); |
| 479 | aliasTable.put("cp864", "Cp864"); |
| 480 | aliasTable.put("csibm864", "Cp864"); |
| 481 | |
| 482 | // MIBenum: 2052 |
| 483 | aliasTable.put("ibm865", "Cp865"); |
| 484 | aliasTable.put("ibm-865", "Cp865"); |
| 485 | aliasTable.put("cp865", "Cp865"); |
| 486 | aliasTable.put("865", "Cp865"); |
| 487 | aliasTable.put("csibm865", "Cp865"); |
| 488 | |
| 489 | // MIBenum: ???? |
| 490 | aliasTable.put("ibm866", "Cp866"); |
| 491 | aliasTable.put("ibm-866", "Cp866"); |
| 492 | aliasTable.put("cp866", "Cp866"); |
| 493 | aliasTable.put("866", "Cp866"); |
| 494 | aliasTable.put("csibm866", "Cp866"); |
| 495 | |
| 496 | // MIBenum: ???? |
| 497 | aliasTable.put("ibm868", "Cp868"); |
| 498 | aliasTable.put("ibm-868", "Cp868"); |
| 499 | aliasTable.put("cp868", "Cp868"); |
| 500 | aliasTable.put("868", "Cp868"); |
| 501 | |
| 502 | // MIBenum: 2054 |
| 503 | aliasTable.put("ibm869", "Cp869"); |
| 504 | aliasTable.put("ibm-869", "Cp869"); |
| 505 | aliasTable.put("cp869", "Cp869"); |
| 506 | aliasTable.put("869", "Cp869"); |
| 507 | aliasTable.put("cp-gr", "Cp869"); |
| 508 | aliasTable.put("csibm869", "Cp869"); |
| 509 | |
| 510 | // MIBenum: ???? |
| 511 | aliasTable.put("ibm870", "Cp870"); |
| 512 | aliasTable.put("ibm-870", "Cp870"); |
| 513 | aliasTable.put("cp870", "Cp870"); |
| 514 | aliasTable.put("870", "Cp870"); |
| 515 | |
| 516 | // MIBenum: ???? |
| 517 | aliasTable.put("ibm871", "Cp871"); |
| 518 | aliasTable.put("ibm-871", "Cp871"); |
| 519 | aliasTable.put("cp871", "Cp871"); |
| 520 | aliasTable.put("871", "Cp871"); |
| 521 | |
| 522 | // MIBenum: ???? |
| 523 | aliasTable.put("ibm874", "Cp874"); |
| 524 | aliasTable.put("ibm-874", "Cp874"); |
| 525 | aliasTable.put("cp874", "Cp874"); |
| 526 | aliasTable.put("874", "Cp874"); |
| 527 | |
| 528 | // MIBenum: ???? |
| 529 | aliasTable.put("ibm875", "Cp875"); |
| 530 | aliasTable.put("ibm-875", "Cp875"); |
| 531 | aliasTable.put("cp875", "Cp875"); |
| 532 | aliasTable.put("875", "Cp875"); |
| 533 | |
| 534 | // MIBenum: ???? |
| 535 | aliasTable.put("ibm918", "Cp918"); |
| 536 | aliasTable.put("ibm-918", "Cp918"); |
| 537 | aliasTable.put("cp918", "Cp918"); |
| 538 | aliasTable.put("918", "Cp918"); |
| 539 | |
| 540 | // MIBenum: ???? |
| 541 | aliasTable.put("ibm921", "Cp921"); |
| 542 | aliasTable.put("ibm-921", "Cp921"); |
| 543 | aliasTable.put("cp921", "Cp921"); |
| 544 | aliasTable.put("921", "Cp921"); |
| 545 | |
| 546 | // MIBenum: ???? |
| 547 | aliasTable.put("ibm922", "Cp922"); |
| 548 | aliasTable.put("ibm-922", "Cp922"); |
| 549 | aliasTable.put("cp922", "Cp922"); |
| 550 | aliasTable.put("922", "Cp922"); |
| 551 | |
| 552 | // MIBenum: ???? |
| 553 | aliasTable.put("ibm930", "Cp930"); /* MDA */ |
| 554 | aliasTable.put("ibm-930", "Cp930"); /* MDA */ |
| 555 | aliasTable.put("cp930", "Cp930"); /* MDA */ |
| 556 | aliasTable.put("930", "Cp930"); /* MDA */ |
| 557 | |
| 558 | // MIBenum: ???? |
| 559 | aliasTable.put("ibm933", "Cp933"); /* MDA */ |
| 560 | aliasTable.put("ibm-933", "Cp933"); /* MDA */ |
| 561 | aliasTable.put("cp933", "Cp933"); /* MDA */ |
| 562 | aliasTable.put("933", "Cp933"); /* MDA */ |
| 563 | |
| 564 | // MIBenum: ???? |
| 565 | aliasTable.put("ibm935", "Cp935"); /* MDA */ |
| 566 | aliasTable.put("ibm-935", "Cp935"); /* MDA */ |
| 567 | aliasTable.put("cp935", "Cp935"); /* MDA */ |
| 568 | aliasTable.put("935", "Cp935"); /* MDA */ |
| 569 | |
| 570 | // MIBenum: ???? |
| 571 | aliasTable.put("ibm937", "Cp937"); /* MDA */ |
| 572 | aliasTable.put("ibm-937", "Cp937"); /* MDA */ |
| 573 | aliasTable.put("cp937", "Cp937"); /* MDA */ |
| 574 | aliasTable.put("937", "Cp937"); /* MDA */ |
| 575 | |
| 576 | // MIBenum: ???? |
| 577 | aliasTable.put("ibm939", "Cp939"); /* MDA */ |
| 578 | aliasTable.put("ibm-939", "Cp939"); /* MDA */ |
| 579 | aliasTable.put("cp939", "Cp939"); /* MDA */ |
| 580 | aliasTable.put("939", "Cp939"); /* MDA */ |
| 581 | |
| 582 | // MIBenum: ???? |
| 583 | aliasTable.put("ibm942", "Cp942"); /* MDA */ |
| 584 | aliasTable.put("ibm-942", "Cp942"); /* MDA */ |
| 585 | aliasTable.put("cp942", "Cp942"); /* MDA */ |
| 586 | aliasTable.put("942", "Cp942"); /* MDA */ |
| 587 | |
| 588 | // MIBenum: ???? |
| 589 | aliasTable.put("ibm943", "Cp943"); /* ibm.3158 */ |
| 590 | aliasTable.put("ibm-943", "Cp943"); /* ibm.3158 */ |
| 591 | aliasTable.put("cp943", "Cp943"); /* ibm.3158 */ |
| 592 | aliasTable.put("943", "Cp943"); /* ibm.3158 */ |
| 593 | |
| 594 | // MIBenum: ???? |
| 595 | aliasTable.put("ibm948", "Cp948"); /* MDA */ |
| 596 | aliasTable.put("ibm-948", "Cp948"); /* MDA */ |
| 597 | aliasTable.put("cp948", "Cp948"); /* MDA */ |
| 598 | aliasTable.put("948", "Cp948"); /* MDA */ |
| 599 | |
| 600 | // MIBenum: ???? |
| 601 | aliasTable.put("ibm949", "Cp949"); /* MDA */ |
| 602 | aliasTable.put("ibm-949", "Cp949"); /* MDA */ |
| 603 | aliasTable.put("cp949", "Cp949"); /* MDA */ |
| 604 | aliasTable.put("949", "Cp949"); /* MDA */ |
| 605 | |
| 606 | // MIBenum: ???? |
| 607 | aliasTable.put("ibm950", "Cp950"); /* MDA */ |
| 608 | aliasTable.put("ibm-950", "Cp950"); /* MDA */ |
| 609 | aliasTable.put("cp950", "Cp950"); /* MDA */ |
| 610 | aliasTable.put("950", "Cp950"); /* MDA */ |
| 611 | |
| 612 | // MIBenum: ???? |
| 613 | aliasTable.put("ibm964", "Cp964"); /* MDA */ |
| 614 | aliasTable.put("ibm-964", "Cp964"); /* MDA */ |
| 615 | aliasTable.put("cp964", "Cp964"); /* MDA */ |
| 616 | aliasTable.put("964", "Cp964"); /* MDA */ |
| 617 | |
| 618 | // MIBenum: ???? |
| 619 | aliasTable.put("ibm970", "Cp970"); /* MDA */ |
| 620 | aliasTable.put("ibm-970", "Cp970"); /* MDA */ |
| 621 | aliasTable.put("cp970", "Cp970"); /* MDA */ |
| 622 | aliasTable.put("970", "Cp970"); /* MDA */ |
| 623 | |
| 624 | // MIBenum: ???? |
| 625 | aliasTable.put("ibm1006", "Cp1006"); |
| 626 | aliasTable.put("ibm-1006", "Cp1006"); |
| 627 | aliasTable.put("cp1006", "Cp1006"); |
| 628 | aliasTable.put("1006", "Cp1006"); |
| 629 | |
| 630 | // MIBenum: ???? |
| 631 | aliasTable.put("ibm1025", "Cp1025"); |
| 632 | aliasTable.put("ibm-1025", "Cp1025"); |
| 633 | aliasTable.put("cp1025", "Cp1025"); |
| 634 | aliasTable.put("1025", "Cp1025"); |
| 635 | |
| 636 | // MIBenum: ???? |
| 637 | aliasTable.put("ibm1026", "Cp1026"); |
| 638 | aliasTable.put("ibm-1026", "Cp1026"); |
| 639 | aliasTable.put("cp1026", "Cp1026"); |
| 640 | aliasTable.put("1026", "Cp1026"); |
| 641 | |
| 642 | // MIBenum: ???? |
| 643 | aliasTable.put("ibm1097", "Cp1097"); |
| 644 | aliasTable.put("ibm-1097", "Cp1097"); |
| 645 | aliasTable.put("cp1097", "Cp1097"); |
| 646 | aliasTable.put("1097", "Cp1097"); |
| 647 | |
| 648 | // MIBenum: ???? |
| 649 | aliasTable.put("ibm1098", "Cp1098"); |
| 650 | aliasTable.put("ibm-1098", "Cp1098"); |
| 651 | aliasTable.put("cp1098", "Cp1098"); |
| 652 | aliasTable.put("1098", "Cp1098"); |
| 653 | |
| 654 | // MIBenum: ???? |
| 655 | aliasTable.put("ibm1112", "Cp1112"); |
| 656 | aliasTable.put("ibm-1112", "Cp1112"); |
| 657 | aliasTable.put("cp1112", "Cp1112"); |
| 658 | aliasTable.put("1112", "Cp1112"); |
| 659 | |
| 660 | // MIBenum: ???? |
| 661 | aliasTable.put("ibm1122", "Cp1122"); |
| 662 | aliasTable.put("ibm-1122", "Cp1122"); |
| 663 | aliasTable.put("cp1122", "Cp1122"); |
| 664 | aliasTable.put("1122", "Cp1122"); |
| 665 | |
| 666 | // MIBenum: ???? |
| 667 | aliasTable.put("ibm1123", "Cp1123"); |
| 668 | aliasTable.put("ibm-1123", "Cp1123"); |
| 669 | aliasTable.put("cp1123", "Cp1123"); |
| 670 | aliasTable.put("1123", "Cp1123"); |
| 671 | |
| 672 | // MIBenum: ???? |
| 673 | aliasTable.put("ibm1124", "Cp1124"); |
| 674 | aliasTable.put("ibm-1124", "Cp1124"); |
| 675 | aliasTable.put("cp1124", "Cp1124"); |
| 676 | aliasTable.put("1124", "Cp1124"); |
| 677 | |
| 678 | // MIBenum: ???? |
Sean Coffey | 79240ea | 2015-02-26 09:36:30 +0000 | [diff] [blame] | 679 | aliasTable.put("ibm1166", "Cp1166"); |
| 680 | aliasTable.put("ibm-1166", "Cp1166"); |
| 681 | aliasTable.put("cp1166", "Cp1166"); |
| 682 | aliasTable.put("1166", "Cp1166"); |
| 683 | |
| 684 | // MIBenum: ???? |
Xueming Shen | b09ac3b | 2010-01-27 19:39:55 -0800 | [diff] [blame] | 685 | aliasTable.put("ibm1381", "Cp1381"); /* MDA */ |
| 686 | aliasTable.put("ibm-1381", "Cp1381"); /* MDA */ |
| 687 | aliasTable.put("cp1381", "Cp1381"); /* MDA */ |
| 688 | aliasTable.put("1381", "Cp1381"); /* MDA */ |
| 689 | |
| 690 | // MIBenum: ???? |
| 691 | aliasTable.put("ibm1383", "Cp1383"); /* MDA */ |
| 692 | aliasTable.put("ibm-1383", "Cp1383"); /* MDA */ |
| 693 | aliasTable.put("cp1383", "Cp1383"); /* MDA */ |
| 694 | aliasTable.put("1383", "Cp1383"); /* MDA */ |
| 695 | |
| 696 | // MIBenum: 16/39 |
| 697 | aliasTable.put("jis", "ISO2022JP"); |
| 698 | aliasTable.put("iso-2022-jp", "ISO2022JP"); |
| 699 | aliasTable.put("csiso2022jp", "ISO2022JP"); |
| 700 | aliasTable.put("jis_encoding", "ISO2022JP"); |
| 701 | aliasTable.put("csjisencoding", "ISO2022JP"); |
| 702 | |
| 703 | // MIBenum: 17/2024 |
| 704 | aliasTable.put("windows-31j", "MS932"); |
| 705 | aliasTable.put("cswindows31j", "MS932"); |
| 706 | |
| 707 | |
| 708 | aliasTable.put("pck", "PCK"); // Case independent PCK alias |
| 709 | |
| 710 | /*if (sjisIsMS932) { |
| 711 | aliasTable.put("shift_jis", "MS932"); // IANA shift jis aliases |
| 712 | aliasTable.put("csshiftjis", "MS932"); // updated per 4556882 |
| 713 | aliasTable.put("x-sjis", "MS932"); |
| 714 | aliasTable.put("ms_kanji", "MS932"); |
| 715 | } else { |
| 716 | */ |
| 717 | aliasTable.put("shift_jis", "SJIS"); // IANA shift jis aliases |
| 718 | aliasTable.put("csshiftjis", "SJIS"); |
| 719 | aliasTable.put("x-sjis", "SJIS"); |
| 720 | aliasTable.put("ms_kanji", "SJIS"); |
| 721 | /* |
| 722 | } |
| 723 | */ |
| 724 | // MIBenum: 18 |
| 725 | // Japanese EUC |
| 726 | aliasTable.put("eucjis", "EUC_JP"); |
| 727 | aliasTable.put("euc-jp", "EUC_JP"); |
| 728 | aliasTable.put("eucjp", "EUC_JP"); |
| 729 | aliasTable.put("extended_unix_code_packed_format_for_japanese", |
| 730 | "EUC_JP"); |
| 731 | aliasTable.put("cseucpkdfmtjapanese", "EUC_JP"); |
| 732 | aliasTable.put("x-euc-jp", "EUC_JP"); |
| 733 | aliasTable.put("x-eucjp", "EUC_JP"); |
| 734 | aliasTable.put("eucjp-open", "EUC_JP_Solaris"); // 1.3.1_x compatibility |
| 735 | |
| 736 | // For handing only JIS0202 and JIS0208 in linux |
| 737 | aliasTable.put("euc-jp-linux", "EUC_JP_LINUX"); |
| 738 | |
| 739 | // MIBenum: 874 |
| 740 | aliasTable.put("windows-874", "MS874"); |
| 741 | |
| 742 | // MIBenum: 2250 |
| 743 | aliasTable.put("windows-1250", "Cp1250"); |
| 744 | |
| 745 | // MIBenum: 2251 |
| 746 | aliasTable.put("windows-1251", "Cp1251"); |
| 747 | aliasTable.put("ansi-1251", "Cp1251"); // Solaris ru_RU.ANSI1251 locale |
| 748 | |
| 749 | // MIBenum: 2252 |
| 750 | aliasTable.put("windows-1252", "Cp1252"); |
| 751 | |
| 752 | // MIBenum: 2253 |
| 753 | aliasTable.put("windows-1253", "Cp1253"); |
| 754 | |
| 755 | // MIBenum: 2254 |
| 756 | aliasTable.put("windows-1254", "Cp1254"); |
| 757 | |
| 758 | // MIBenum: 2255 |
| 759 | aliasTable.put("windows-1255", "Cp1255"); |
| 760 | |
| 761 | // MIBenum: 2256 |
| 762 | aliasTable.put("windows-1256", "Cp1256"); |
| 763 | |
| 764 | // MIBenum: 2257 |
| 765 | aliasTable.put("windows-1257", "Cp1257"); |
| 766 | |
| 767 | // MIBenum: 2258 |
| 768 | aliasTable.put("windows-1258", "Cp1258"); |
| 769 | |
| 770 | // MIBenum: ???? |
| 771 | aliasTable.put("ibm33722", "Cp33722"); /* MDA */ |
| 772 | aliasTable.put("ibm-33722", "Cp33722"); /* MDA */ |
| 773 | aliasTable.put("cp33722", "Cp33722"); /* MDA */ |
| 774 | aliasTable.put("33722", "Cp33722"); /* MDA */ |
| 775 | |
| 776 | // Russian KOI8-R |
| 777 | aliasTable.put("koi8-r", "KOI8_R"); |
| 778 | aliasTable.put("koi8", "KOI8_R"); |
| 779 | aliasTable.put("cskoi8r", "KOI8_R"); |
| 780 | |
| 781 | // Simplified Chinese |
| 782 | aliasTable.put("gb2312", "EUC_CN"); |
| 783 | aliasTable.put("gb2312-80", "EUC_CN"); |
| 784 | aliasTable.put("gb2312-1980", "EUC_CN"); |
| 785 | aliasTable.put("euc-cn", "EUC_CN"); |
| 786 | aliasTable.put("euccn", "EUC_CN"); |
| 787 | |
| 788 | aliasTable.put("big5", "Big5"); |
| 789 | aliasTable.put("big5hk", "Big5_HKSCS"); |
| 790 | aliasTable.put("big5-hkscs", "Big5_HKSCS"); |
| 791 | // Added for future compatibility, explicit mapping to Unicode 3.0 |
| 792 | aliasTable.put("big5-hkscs:unicode3.0", "Big5_HKSCS"); |
| 793 | aliasTable.put("big5_solaris", "Big5_Solaris"); |
| 794 | |
| 795 | // Traditional Chinese |
| 796 | aliasTable.put("cns11643", "EUC_TW"); |
| 797 | aliasTable.put("euc-tw", "EUC_TW"); |
| 798 | aliasTable.put("euctw", "EUC_TW"); |
| 799 | |
| 800 | // Korean |
| 801 | aliasTable.put("ksc5601", "EUC_KR"); |
| 802 | aliasTable.put("euc-kr", "EUC_KR"); |
| 803 | aliasTable.put("euckr", "EUC_KR"); |
| 804 | aliasTable.put("ks_c_5601-1987", "EUC_KR"); |
| 805 | aliasTable.put("ksc5601-1987", "EUC_KR"); |
| 806 | aliasTable.put("ksc5601_1987", "EUC_KR"); |
| 807 | aliasTable.put("ksc_5601", "EUC_KR"); |
| 808 | aliasTable.put("5601", "EUC_KR"); |
| 809 | |
| 810 | aliasTable.put("ksc5601-1992", "Johab"); |
| 811 | aliasTable.put("ksc5601_1992", "Johab"); |
| 812 | aliasTable.put("ms1361", "Johab"); |
| 813 | |
| 814 | aliasTable.put("windows-949", "MS949"); |
| 815 | |
| 816 | //MIBenum: 37 |
| 817 | aliasTable.put("iso-2022-kr", "ISO2022KR"); |
| 818 | aliasTable.put("csiso2022kr", "ISO2022KR"); |
| 819 | |
| 820 | // Thai |
| 821 | aliasTable.put("tis620.2533", "TIS620"); |
| 822 | aliasTable.put("tis-620", "TIS620"); // Linux name |
| 823 | |
| 824 | // Variants |
| 825 | aliasTable.put("cp942c", "Cp942C"); |
| 826 | aliasTable.put("cp943c", "Cp943C"); |
| 827 | aliasTable.put("cp949c", "Cp949C"); |
| 828 | aliasTable.put("iscii", "ISCII91"); |
| 829 | } |
| 830 | } |