Lines Matching refs:charset
33 import java.nio.charset.Charset;
34 import java.nio.charset.UnsupportedCharsetException;
51 final Charset charset = Charset.forName(enc);
57 /* String(byte[] bs, Charset charset) */
58 if (!(new String(bytes, charset).equals(str)))
59 throw new Exception(charset + ": String constructor failed");
61 /* String(byte[] bs, int off, int len, Charset charset) */
65 if (!(new String(bytes, 0, 4, charset).equals(start)))
66 throw new Exception(charset + ": String constructor failed");
67 if (!(new String(bytes, 4, bytes.length - 4, charset).equals(end)))
68 throw new Exception(charset + ": String constructor failed");
70 if (!(new String(bytes, 0, 6, charset).equals(start)))
71 throw new Exception(charset + ": String constructor failed");
73 if (!(new String(bytes, 0, 2, charset).equals(start)))
74 throw new Exception(charset + ": String constructor failed");
75 if (!(new String(bytes, 2, bytes.length - 2, charset).equals(end)))
76 throw new Exception(charset + ": String constructor failed");
104 /* String.getBytes(Charset charset) */
105 bs = str.getBytes(charset);
107 throw new Exception(charset + ": String.getBytes failed");
111 if (charset.name().equals("UTF-16BE")) {
112 String s = new String(bytes, charset);