Path: blob/master/src/java.base/share/classes/sun/nio/cs/Unicode.java
41159 views
/*1* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.nio.cs;2627import java.nio.charset.Charset;2829abstract class Unicode extends Charset30implements HistoricallyNamedCharset31{32public Unicode(String name, String[] aliases) {33super(name, aliases);34}3536public boolean contains(Charset cs) {37return ((cs instanceof US_ASCII)38|| (cs instanceof ISO_8859_1)39|| (cs instanceof ISO_8859_15)40|| (cs instanceof ISO_8859_16)41|| (cs instanceof MS1252)42|| (cs instanceof UTF_8)43|| (cs instanceof UTF_16)44|| (cs instanceof UTF_16BE)45|| (cs instanceof UTF_16LE)46|| (cs instanceof UTF_16LE_BOM)47|| (cs.name().equals("GBK"))48|| (cs.name().equals("GB18030"))49|| (cs.name().equals("ISO-8859-2"))50|| (cs.name().equals("ISO-8859-3"))51|| (cs.name().equals("ISO-8859-4"))52|| (cs.name().equals("ISO-8859-5"))53|| (cs.name().equals("ISO-8859-6"))54|| (cs.name().equals("ISO-8859-7"))55|| (cs.name().equals("ISO-8859-8"))56|| (cs.name().equals("ISO-8859-9"))57|| (cs.name().equals("ISO-8859-13"))58|| (cs.name().equals("JIS_X0201"))59|| (cs.name().equals("x-JIS0208"))60|| (cs.name().equals("JIS_X0212-1990"))61|| (cs.name().equals("GB2312"))62|| (cs.name().equals("EUC-KR"))63|| (cs.name().equals("x-EUC-TW"))64|| (cs.name().equals("EUC-JP"))65|| (cs.name().equals("x-euc-jp-linux"))66|| (cs.name().equals("KOI8-R"))67|| (cs.name().equals("TIS-620"))68|| (cs.name().equals("x-ISCII91"))69|| (cs.name().equals("windows-1251"))70|| (cs.name().equals("windows-1253"))71|| (cs.name().equals("windows-1254"))72|| (cs.name().equals("windows-1255"))73|| (cs.name().equals("windows-1256"))74|| (cs.name().equals("windows-1257"))75|| (cs.name().equals("windows-1258"))76|| (cs.name().equals("windows-932"))77|| (cs.name().equals("x-mswin-936"))78|| (cs.name().equals("x-windows-949"))79|| (cs.name().equals("x-windows-950"))80|| (cs.name().equals("windows-31j"))81|| (cs.name().equals("Big5"))82|| (cs.name().equals("Big5-HKSCS"))83|| (cs.name().equals("x-MS950-HKSCS"))84|| (cs.name().equals("ISO-2022-JP"))85|| (cs.name().equals("ISO-2022-KR"))86|| (cs.name().equals("x-ISO-2022-CN-CNS"))87|| (cs.name().equals("x-ISO-2022-CN-GB"))88|| (cs.name().equals("x-Johab"))89|| (cs.name().equals("Shift_JIS")));90}91}929394