blob: 6d63458c071421024a2be13358f50aab7fc406a2 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2005 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package sun.nio.cs;
27
28import java.nio.charset.Charset;
29
30abstract class Unicode extends Charset
31 implements HistoricallyNamedCharset
32{
33 public Unicode(String name, String[] aliases) {
34 super(name, aliases);
35 }
36
37 public boolean contains(Charset cs) {
38 return ((cs instanceof US_ASCII)
39 || (cs instanceof ISO_8859_1)
40 || (cs instanceof ISO_8859_15)
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("Big5-HKSCS"))
89 || (cs.name().equals("x-Johab"))
90 || (cs.name().equals("Shift_JIS")));
91 }
92}