01: /*
02: * @(#)ByteToCharCp949C.java 1.11 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: import sun.io.*;
31:
32: public class ByteToCharCp949C extends ByteToCharDBCS_ASCII {
33: protected static final String singleByteToChar;
34: protected static final boolean leadByte[];
35: protected static final short index1[];
36: protected static final String index2;
37: protected static final int mask1;
38: protected static final int mask2;
39: protected static final int shift;
40: static {
41: ByteToCharDBCS_ASCII y = new ByteToCharCp949();
42: mask1 = y.mask1;
43: mask2 = y.mask2;
44: shift = y.shift;
45: leadByte = y.leadByte;
46: index1 = y.index1;
47: index2 = y.index2;
48: /* Fix converter to pass through 0x00 to 0x7f unchanged to U+0000 to U+007F */
49: String indexs = "";
50: for (char c = '\0'; c < '\u0080'; ++c)
51: indexs += c;
52: singleByteToChar = indexs
53: + y.singleByteToChar.substring(indexs.length());
54: }
55:
56: public String getCharacterEncoding() {
57: return "Cp949C";
58: }
59:
60: ByteToCharCp949C() {
61: super();
62: super.mask1 = mask1;
63: super.mask2 = mask2;
64: super.shift = shift;
65: super.leadByte = leadByte;
66: super.singleByteToChar = singleByteToChar;
67: super.index1 = index1;
68: super.index2 = index2;
69: }
70: }
|