34 import static sun.nio.cs.CharsetMapping.*; 35 36 public class Big5_Solaris extends Charset implements HistoricallyNamedCharset 37 { 38 public Big5_Solaris() { 39 super("x-Big5-Solaris", $ALIASES$); 40 } 41 42 public String historicalName() { 43 return "Big5_Solaris"; 44 } 45 46 public boolean contains(Charset cs) { 47 return ((cs.name().equals("US-ASCII")) 48 || (cs instanceof Big5) 49 || (cs instanceof Big5_Solaris)); 50 } 51 52 public CharsetDecoder newDecoder() { 53 initb2c(); 54 return new DoubleByte.Decoder(this, b2c, b2cSB, 0x40, 0xfe); 55 } 56 57 public CharsetEncoder newEncoder() { 58 initc2b(); 59 return new DoubleByte.Encoder(this, c2b, c2bIndex); 60 } 61 62 static char[][] b2c; 63 static char[] b2cSB; 64 private static volatile boolean b2cInitialized = false; 65 66 static void initb2c() { 67 if (b2cInitialized) 68 return; 69 synchronized (Big5_Solaris.class) { 70 if (b2cInitialized) 71 return; 72 Big5.initb2c(); 73 b2c = Big5.b2c.clone(); 74 // Big5 Solaris implementation has 7 additional mappings 75 int[] sol = new int[] { 76 0xF9D6, 0x7881, 77 0xF9D7, 0x92B9, 78 0xF9D8, 0x88CF, 79 0xF9D9, 0x58BB, | 34 import static sun.nio.cs.CharsetMapping.*; 35 36 public class Big5_Solaris extends Charset implements HistoricallyNamedCharset 37 { 38 public Big5_Solaris() { 39 super("x-Big5-Solaris", $ALIASES$); 40 } 41 42 public String historicalName() { 43 return "Big5_Solaris"; 44 } 45 46 public boolean contains(Charset cs) { 47 return ((cs.name().equals("US-ASCII")) 48 || (cs instanceof Big5) 49 || (cs instanceof Big5_Solaris)); 50 } 51 52 public CharsetDecoder newDecoder() { 53 initb2c(); 54 return new DoubleByte.Decoder(this, b2c, b2cSB, 0x40, 0xfe, true); 55 } 56 57 public CharsetEncoder newEncoder() { 58 initc2b(); 59 return new DoubleByte.Encoder(this, c2b, c2bIndex, true); 60 } 61 62 static char[][] b2c; 63 static char[] b2cSB; 64 private static volatile boolean b2cInitialized = false; 65 66 static void initb2c() { 67 if (b2cInitialized) 68 return; 69 synchronized (Big5_Solaris.class) { 70 if (b2cInitialized) 71 return; 72 Big5.initb2c(); 73 b2c = Big5.b2c.clone(); 74 // Big5 Solaris implementation has 7 additional mappings 75 int[] sol = new int[] { 76 0xF9D6, 0x7881, 77 0xF9D7, 0x92B9, 78 0xF9D8, 0x88CF, 79 0xF9D9, 0x58BB, |