1 /*
2 * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
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 *
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.
22 */
23
24 /*
25 * @test
26 * @bug 4625418
27 * @summary Tests XML <a href="http://download.java.net/jdk6/docs/technotes/guides/intl/encoding.doc.html">encoding</a>
28 * @author Sergey Malenkov
29 * @run main/timeout=360 Test4625418
30 */
31
32 import java.beans.ExceptionListener;
33 import java.beans.XMLDecoder;
34 import java.beans.XMLEncoder;
35 import java.io.ByteArrayInputStream;
36 import java.io.ByteArrayOutputStream;
37 import java.io.InputStream;
38 import java.nio.charset.IllegalCharsetNameException;
39 import java.nio.charset.UnsupportedCharsetException;
40
41 public final class Test4625418 implements ExceptionListener {
42
43 private static final String[] encodings = {
44 "ASCII",
45 "Big5",
46 //"Big5-HKSCS",
109 "Cp863",
110 "Cp864",
111 "Cp865",
112 "Cp866",
113 "Cp868",
114 "Cp869",
115 //"Cp870",
116 //"Cp871",
117 "Cp874",
118 //"Cp875",
119 //"Cp918",
120 "Cp921",
121 "Cp922",
122 //"Cp930",
123 "Cp933",
124 //"Cp935",
125 //"Cp937",
126 //"Cp939",
127 //"Cp942",
128 //"Cp942C",
129 "Cp943",
130 //"Cp943C",
131 "Cp948",
132 "Cp949",
133 //"Cp949C",
134 "Cp950",
135 "Cp964",
136 //"Cp970",
137 //"EUC-JP",
138 "EUC-KR",
139 "EUC_CN",
140 //"EUC_JP",
141 //"EUC_JP_LINUX",
142 //"EUC_JP_Solaris",
143 "EUC_KR",
144 //"EUC_TW",
145 "GB18030",
146 "GB2312",
147 "GBK",
148 //"IBM-Thai",
149 "IBM00858",
290 //"x-IBM1122",
291 //"x-IBM1123",
292 "x-IBM1124",
293 //"x-IBM1381",
294 //"x-IBM1383",
295 //"x-IBM33722",
296 "x-IBM737",
297 //"x-IBM834",
298 "x-IBM856",
299 "x-IBM874",
300 //"x-IBM875",
301 "x-IBM921",
302 "x-IBM922",
303 //"x-IBM930",
304 "x-IBM933",
305 //"x-IBM935",
306 //"x-IBM937",
307 //"x-IBM939",
308 //"x-IBM942",
309 //"x-IBM942C",
310 "x-IBM943",
311 //"x-IBM943C",
312 "x-IBM948",
313 "x-IBM949",
314 //"x-IBM949C",
315 "x-IBM950",
316 "x-IBM964",
317 //"x-IBM970",
318 //"x-ISCII91",
319 //"x-ISO2022-CN-CNS",
320 //"x-ISO2022-CN-GB",
321 //"x-JIS0208",
322 //"x-JISAutoDetect",
323 "x-Johab",
324 //"x-MS950-HKSCS",
325 "x-MacArabic",
326 "x-MacCentralEurope",
327 "x-MacCroatian",
328 "x-MacCyrillic",
329 //"x-MacDingbat",
330 "x-MacGreek",
|
1 /*
2 * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
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 *
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.
22 */
23
24 /*
25 * @test
26 * @bug 4625418 8239965
27 * @summary Tests XML <a href="http://download.java.net/jdk6/docs/technotes/guides/intl/encoding.doc.html">encoding</a>
28 * @author Sergey Malenkov
29 * @run main/timeout=360 Test4625418
30 */
31
32 import java.beans.ExceptionListener;
33 import java.beans.XMLDecoder;
34 import java.beans.XMLEncoder;
35 import java.io.ByteArrayInputStream;
36 import java.io.ByteArrayOutputStream;
37 import java.io.InputStream;
38 import java.nio.charset.IllegalCharsetNameException;
39 import java.nio.charset.UnsupportedCharsetException;
40
41 public final class Test4625418 implements ExceptionListener {
42
43 private static final String[] encodings = {
44 "ASCII",
45 "Big5",
46 //"Big5-HKSCS",
109 "Cp863",
110 "Cp864",
111 "Cp865",
112 "Cp866",
113 "Cp868",
114 "Cp869",
115 //"Cp870",
116 //"Cp871",
117 "Cp874",
118 //"Cp875",
119 //"Cp918",
120 "Cp921",
121 "Cp922",
122 //"Cp930",
123 "Cp933",
124 //"Cp935",
125 //"Cp937",
126 //"Cp939",
127 //"Cp942",
128 //"Cp942C",
129 //"Cp943",
130 //"Cp943C",
131 "Cp948",
132 "Cp949",
133 //"Cp949C",
134 "Cp950",
135 "Cp964",
136 //"Cp970",
137 //"EUC-JP",
138 "EUC-KR",
139 "EUC_CN",
140 //"EUC_JP",
141 //"EUC_JP_LINUX",
142 //"EUC_JP_Solaris",
143 "EUC_KR",
144 //"EUC_TW",
145 "GB18030",
146 "GB2312",
147 "GBK",
148 //"IBM-Thai",
149 "IBM00858",
290 //"x-IBM1122",
291 //"x-IBM1123",
292 "x-IBM1124",
293 //"x-IBM1381",
294 //"x-IBM1383",
295 //"x-IBM33722",
296 "x-IBM737",
297 //"x-IBM834",
298 "x-IBM856",
299 "x-IBM874",
300 //"x-IBM875",
301 "x-IBM921",
302 "x-IBM922",
303 //"x-IBM930",
304 "x-IBM933",
305 //"x-IBM935",
306 //"x-IBM937",
307 //"x-IBM939",
308 //"x-IBM942",
309 //"x-IBM942C",
310 //"x-IBM943",
311 //"x-IBM943C",
312 "x-IBM948",
313 "x-IBM949",
314 //"x-IBM949C",
315 "x-IBM950",
316 "x-IBM964",
317 //"x-IBM970",
318 //"x-ISCII91",
319 //"x-ISO2022-CN-CNS",
320 //"x-ISO2022-CN-GB",
321 //"x-JIS0208",
322 //"x-JISAutoDetect",
323 "x-Johab",
324 //"x-MS950-HKSCS",
325 "x-MacArabic",
326 "x-MacCentralEurope",
327 "x-MacCroatian",
328 "x-MacCyrillic",
329 //"x-MacDingbat",
330 "x-MacGreek",
|