518N/A/*
2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
518N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
518N/A *
518N/A * This code is free software; you can redistribute it and/or modify it
518N/A * under the terms of the GNU General Public License version 2 only, as
518N/A * published by the Free Software Foundation.
518N/A *
518N/A * This code is distributed in the hope that it will be useful, but WITHOUT
518N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
518N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
518N/A * version 2 for more details (a copy is included in the LICENSE file that
518N/A * accompanied this code).
518N/A *
518N/A * You should have received a copy of the GNU General Public License version
518N/A * 2 along with this work; if not, write to the Free Software Foundation,
518N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
518N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
518N/A */
518N/A
518N/A/* @test
518N/A @bug 4849617
518N/A @summary Checks "+" is a legal character for charset name
518N/A */
518N/Aimport java.nio.charset.*;
518N/A
518N/Apublic class CheckICNE {
518N/A static int failed = 0;
518N/A public static void main (String[] args) throws Exception {
518N/A try {
518N/A Charset.forName("abc+");
518N/A } catch (UnsupportedCharsetException uce) {}
518N/A
518N/A try {
518N/A java.nio.charset.Charset.forName("+abc");
518N/A } catch (IllegalCharsetNameException icne) {}
518N/A
518N/A String[] euros = {"PC-Multilingual-850+euro",
518N/A "ebcdic-us-037+euro",
518N/A "ebcdic-de-273+euro",
518N/A "ebcdic-no-277+euro",
518N/A "ebcdic-dk-277+euro",
518N/A "ebcdic-fi-278+euro",
518N/A "ebcdic-se-278+euro",
518N/A "ebcdic-it-280+euro",
518N/A "ebcdic-es-284+euro",
518N/A "ebcdic-gb-285+euro",
518N/A "ebcdic-fr-277+euro",
518N/A "ebcdic-international-500+euro",
518N/A "ebcdic-s-871+euro"
518N/A };
518N/A
518N/A System.out.println("Test Passed!");
518N/A }
518N/A}