jdk/src/share/classes/sun/io/CharToByteBig5_Solaris.java
changeset 5167 dbd299f8fdae
parent 2 90ce3da70b43
child 5506 202f599c92aa
equal deleted inserted replaced
5166:81f798aa5765 5167:dbd299f8fdae
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    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
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
    23  * have any questions.
    24  */
    24  */
    25 
    25 
    26 
       
    27 package sun.io;
    26 package sun.io;
    28 
    27 
    29 /**
    28 import sun.nio.cs.ext.DoubleByte;
    30  */
    29 import sun.nio.cs.ext.Big5_Solaris;
    31 
    30 
    32 public class CharToByteBig5_Solaris extends CharToByteBig5 {
    31 public class CharToByteBig5_Solaris extends CharToByteDBCS_ASCII {
       
    32 
       
    33     private static DoubleByte.Encoder enc =
       
    34         (DoubleByte.Encoder)new Big5_Solaris().newEncoder();
    33 
    35 
    34     public String getCharacterEncoding() {
    36     public String getCharacterEncoding() {
    35         return "Big5_Solaris";
    37         return "Big5_Solaris";
    36     }
    38     }
    37 
    39 
    38     protected int getNative(char ch) {
    40     public CharToByteBig5_Solaris() {
    39         int nativeVal;
    41         super(enc);
    40 
       
    41         if ((nativeVal = super.getNative(ch)) != 0) {
       
    42             return nativeVal;
       
    43         }
       
    44 
       
    45         switch (ch) {
       
    46             case 0x7881:
       
    47                 nativeVal = 0xF9D6;
       
    48                 break;
       
    49             case 0x92B9:
       
    50                 nativeVal = 0xF9D7;
       
    51                 break;
       
    52             case 0x88CF:
       
    53                 nativeVal = 0xF9D8;
       
    54                 break;
       
    55             case 0x58BB:
       
    56                 nativeVal = 0xF9D9;
       
    57                 break;
       
    58             case 0x6052:
       
    59                 nativeVal = 0xF9DA;
       
    60                 break;
       
    61             case 0x7CA7:
       
    62                 nativeVal = 0xF9DB;
       
    63                 break;
       
    64             case 0x5AFA:
       
    65                 nativeVal = 0xF9DC;
       
    66                 break;
       
    67             }
       
    68         return nativeVal;
       
    69     }
    42     }
    70 }
    43 }