01: /*
02: * @(#)ByteToCharISO2022CN.java 1.13 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27:
28: package sun.io;
29:
30: /**
31: * @author Tom Zhou
32: */
33: public class ByteToCharISO2022CN extends ByteToCharISO2022 {
34: public ByteToCharISO2022CN() {
35: SODesignator = new String[3];
36: SODesignator[0] = "$A";
37: SODesignator[1] = "$)A";
38: SODesignator[2] = "$)G";
39: SS2Designator = new String[1];
40: SS2Designator[0] = "$*H";
41: SS3Designator = new String[1];
42: SS3Designator[0] = "$+I";
43: SOConverter = new ByteToCharConverter[3];
44: SS2Converter = new ByteToCharConverter[1];
45: SS3Converter = new ByteToCharConverter[1];
46: try {
47: SOConverter[0] = SOConverter[1] = ByteToCharConverter
48: .getConverter("GB2312");
49: SOConverter[2] = SS2Converter[0] = SS3Converter[0] = ByteToCharConverter
50: .getConverter("CNS11643");
51: } catch (Exception e) {
52: }
53: ;
54: }
55:
56: // Return the character set id
57: public String getCharacterEncoding() {
58: return "ISO2022CN";
59: }
60: }
|