Lines Matching refs:cs
42 for (Charset cs: Charset.availableCharsets().values()) {
43 if ("ISO-2022-CN".equals(cs.name()) ||
44 "x-COMPOUND_TEXT".equals(cs.name()) ||
45 "x-JISAutoDetect".equals(cs.name()))
47 System.out.printf("Testing(sm=%b) " + cs.name() + "....", hasSM);
57 test(cs, bmpCA, sbBA);
64 test(cs, Arrays.copyOf(bmpCA, clen), Arrays.copyOf(sbBA, blen));
71 test(cs, Arrays.copyOf(bmpCA, clen), Arrays.copyOf(sbBA, blen));
78 static void test(Charset cs, char[] bmpCA, byte[] sbBA) throws Throwable {
80 CharsetDecoder dec = cs.newDecoder()
83 CharsetEncoder enc = cs.newEncoder()
88 byte[] baSC = bmpStr.getBytes(cs.name());
93 throw new RuntimeException("getBytes(csn) failed -> " + cs.name());
95 //getBytes(cs);
96 baSC = bmpStr.getBytes(cs);
98 throw new RuntimeException("getBytes(cs) failed -> " + cs.name());
101 String strSC = new String(sbBA, cs.name());
104 throw new RuntimeException("new String(csn) failed -> " + cs.name());
106 //new String(cs);
107 strSC = new String(sbBA, cs);
109 throw new RuntimeException("new String(cs) failed -> " + cs.name());
112 if (enc instanceof sun.nio.cs.ArrayEncoder &&
113 cs.contains(Charset.forName("ASCII"))) {
114 if (cs.name().equals("UTF-8")) // utf8 handles surrogates
117 sun.nio.cs.ArrayEncoder cae = (sun.nio.cs.ArrayEncoder)enc;
122 if (n != 6 || !"abAAcd".equals(new String(ba, cs.name())))
124 + cs.name());
129 cs.name())))
131 + cs.name());
136 cs.name())))
138 + cs.name());
143 cs.name())))
145 + cs.name());