private static final String UNICODE_STRING_2;
private static final byte[] UNICODE_STRING_BYTES_2;
+ private static final String REALLY_WHACKY_ONE = "\u20491";
+ private static final byte[] REALLY_WHACKY_ONE_BYTES;
+
static {
try {
UNICODE_STRING_BYTES = UNICODE_STRING.getBytes("UTF-8");
UNICODE_STRING_2 = new String(kUnicodeBytes, "UTF-8");
UNICODE_STRING_BYTES_2 = UNICODE_STRING_2.getBytes("UTF-8");
+ REALLY_WHACKY_ONE_BYTES = REALLY_WHACKY_ONE.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
otherBytes = Utf8Helper.encode(UNICODE_STRING_2);
assertTrue(Arrays.equals(UNICODE_STRING_BYTES_2, otherBytes));
+
+ otherBytes = Utf8Helper.encode(REALLY_WHACKY_ONE);
+ assertTrue(Arrays.equals(REALLY_WHACKY_ONE_BYTES, otherBytes));
}
public void testDecode() throws Exception {
assertEquals(UNICODE_STRING, Utf8Helper.decode(UNICODE_STRING_BYTES));
assertEquals(UNICODE_STRING_2, Utf8Helper.decode(UNICODE_STRING_BYTES_2));
+ assertEquals(REALLY_WHACKY_ONE, Utf8Helper.decode(REALLY_WHACKY_ONE_BYTES));
}
}