jdk/src/share/classes/sun/io/ByteToCharMS932.java
changeset 3052 5c9886498f31
parent 2 90ce3da70b43
child 5506 202f599c92aa
equal deleted inserted replaced
3051:9481bd560a57 3052:5c9886498f31
    23  * have any questions.
    23  * have any questions.
    24  */
    24  */
    25 
    25 
    26 package sun.io;
    26 package sun.io;
    27 
    27 
    28 /**
    28 import sun.nio.cs.ext.*;
    29  * Tables and data to convert MS932 to Unicode
       
    30  *
       
    31  * @author Limin Shi
       
    32  * @author Mark Son-Bell
       
    33  */
       
    34 
    29 
    35 public class ByteToCharMS932 extends ByteToCharMS932DB {
    30 public class ByteToCharMS932 extends ByteToCharDBCS_ASCII {
    36     ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201();
    31 
       
    32     private static DoubleByte.Decoder dec =
       
    33         (DoubleByte.Decoder)new MS932().newDecoder();
    37 
    34 
    38     public String getCharacterEncoding() {
    35     public String getCharacterEncoding() {
    39         return "MS932";
    36         return "MS932";
    40     }
    37     }
    41 
    38 
    42     protected char convSingleByte(int b) {
    39     public ByteToCharMS932() {
    43         // If the high bits are all off, it's ASCII == Unicode
    40         super(dec);
    44         if ((b & 0xFF80) == 0) {
       
    45             return (char)b;
       
    46         }
       
    47         return bcJIS0201.getUnicode(b);
       
    48     }
    41     }
    49 
    42 
    50     String prt(int i) {
       
    51         return Integer.toString(i,16);
       
    52     }
       
    53 }
    43 }