equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* @test |
24 /* @test |
25 * @bug 6173388 6319716 |
25 * @bug 6173388 6319716 8229960 |
26 * @summary Check full coverage encode/decode for Microsoft |
26 * @summary Check full coverage encode/decode for Microsoft |
27 * ISO2022_JP variants MS50220, MS50221 and MSISO2022JP |
27 * ISO2022_JP variants MS50220, MS50221 and MSISO2022JP |
28 * @modules jdk.charsets |
28 * @modules jdk.charsets |
29 */ |
29 */ |
30 |
30 |
664 throw new Exception(name + " Decoder error"); |
664 throw new Exception(name + " Decoder error"); |
665 } |
665 } |
666 } |
666 } |
667 |
667 |
668 public static void main(String[] args) throws Exception { |
668 public static void main(String[] args) throws Exception { |
669 String map = System.getProperty("sun.nio.cs.map"); |
|
670 if (map != null) { |
|
671 map = map.toLowerCase(java.util.Locale.US); |
|
672 Charset cs = Charset.forName("ISO-2022-JP"); |
|
673 if (map.indexOf("x-windows-50221/ISO-2022-jp") != -1 && |
|
674 !"x-windows-50220".equals(cs.name()) || |
|
675 map.indexOf("x-windows-50220/ISO-2022-jp") != -1 && |
|
676 !"x-windows-50220".equals(cs.name()) || |
|
677 map.indexOf("x-windows-iso2022jp/ISO-2022-jp") != -1 && |
|
678 !"x-windows-iso2022jp".equals(cs.name())) { |
|
679 throw new Exception("Error: sun.nio.cs.map=" + map + |
|
680 ", ISO-2022-JP=" + cs.name()); |
|
681 } else { |
|
682 System.out.printf("ISO-2022-JP=%s\n", cs.name()); |
|
683 } |
|
684 } |
|
685 |
|
686 String testStr = US_ASCII + |
669 String testStr = US_ASCII + |
687 JISX0208SUBSET + |
670 JISX0208SUBSET + |
688 JISX0201KATAKANA + |
671 JISX0201KATAKANA + |
689 JISX0208NECROW13; |
672 JISX0208NECROW13; |
690 |
673 |