2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
2
|
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
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
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 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
package sun.nio.cs;
|
|
27 |
|
|
28 |
import java.nio.charset.Charset;
|
|
29 |
|
|
30 |
abstract 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)
|
47115
|
41 |
|| (cs instanceof ISO_8859_16)
|
2
|
42 |
|| (cs instanceof MS1252)
|
|
43 |
|| (cs instanceof UTF_8)
|
|
44 |
|| (cs instanceof UTF_16)
|
|
45 |
|| (cs instanceof UTF_16BE)
|
|
46 |
|| (cs instanceof UTF_16LE)
|
|
47 |
|| (cs instanceof UTF_16LE_BOM)
|
|
48 |
|| (cs.name().equals("GBK"))
|
|
49 |
|| (cs.name().equals("GB18030"))
|
|
50 |
|| (cs.name().equals("ISO-8859-2"))
|
|
51 |
|| (cs.name().equals("ISO-8859-3"))
|
|
52 |
|| (cs.name().equals("ISO-8859-4"))
|
|
53 |
|| (cs.name().equals("ISO-8859-5"))
|
|
54 |
|| (cs.name().equals("ISO-8859-6"))
|
|
55 |
|| (cs.name().equals("ISO-8859-7"))
|
|
56 |
|| (cs.name().equals("ISO-8859-8"))
|
|
57 |
|| (cs.name().equals("ISO-8859-9"))
|
|
58 |
|| (cs.name().equals("ISO-8859-13"))
|
|
59 |
|| (cs.name().equals("JIS_X0201"))
|
|
60 |
|| (cs.name().equals("x-JIS0208"))
|
|
61 |
|| (cs.name().equals("JIS_X0212-1990"))
|
|
62 |
|| (cs.name().equals("GB2312"))
|
|
63 |
|| (cs.name().equals("EUC-KR"))
|
|
64 |
|| (cs.name().equals("x-EUC-TW"))
|
|
65 |
|| (cs.name().equals("EUC-JP"))
|
|
66 |
|| (cs.name().equals("x-euc-jp-linux"))
|
|
67 |
|| (cs.name().equals("KOI8-R"))
|
|
68 |
|| (cs.name().equals("TIS-620"))
|
|
69 |
|| (cs.name().equals("x-ISCII91"))
|
|
70 |
|| (cs.name().equals("windows-1251"))
|
|
71 |
|| (cs.name().equals("windows-1253"))
|
|
72 |
|| (cs.name().equals("windows-1254"))
|
|
73 |
|| (cs.name().equals("windows-1255"))
|
|
74 |
|| (cs.name().equals("windows-1256"))
|
|
75 |
|| (cs.name().equals("windows-1257"))
|
|
76 |
|| (cs.name().equals("windows-1258"))
|
|
77 |
|| (cs.name().equals("windows-932"))
|
|
78 |
|| (cs.name().equals("x-mswin-936"))
|
|
79 |
|| (cs.name().equals("x-windows-949"))
|
|
80 |
|| (cs.name().equals("x-windows-950"))
|
|
81 |
|| (cs.name().equals("windows-31j"))
|
|
82 |
|| (cs.name().equals("Big5"))
|
|
83 |
|| (cs.name().equals("Big5-HKSCS"))
|
|
84 |
|| (cs.name().equals("x-MS950-HKSCS"))
|
|
85 |
|| (cs.name().equals("ISO-2022-JP"))
|
|
86 |
|| (cs.name().equals("ISO-2022-KR"))
|
|
87 |
|| (cs.name().equals("x-ISO-2022-CN-CNS"))
|
|
88 |
|| (cs.name().equals("x-ISO-2022-CN-GB"))
|
|
89 |
|| (cs.name().equals("Big5-HKSCS"))
|
|
90 |
|| (cs.name().equals("x-Johab"))
|
|
91 |
|| (cs.name().equals("Shift_JIS")));
|
|
92 |
}
|
|
93 |
}
|