|
Project Information
Members
Featured
Downloads
|
To show encoded code string to decoded character string. public void testReadUnicode() {
String string = "김갑돌";
String c2 = StringHelper.readUnicode(string);
assertEquals("김갑돌", c2);
}
public void testReadUnicode2() {
String string = "김갑 돌";
String c2 = StringHelper.readUnicode(string);
assertEquals("김갑 돌", c2);
}
public void testReadUnicode3() {
String string = "abc";
String c2 = StringHelper.readUnicode(string);
assertEquals("abc", c2);
}
public void testReadNull() {
String string = null;
String c2 = StringHelper.readUnicode(string);
assertEquals(null, c2);
}
public void testSplit() {
String[] strings = "김갑돌".split("&#");
assertEquals(4, strings.length);
assertEquals("", strings[0]);
assertEquals("44608;", strings[1]);
}
public void testCode() {
String unicode = "가나다라마";
assertEquals("가나다라마", StringHelper.readUnicode(unicode));
}
public void testCodeMixed() {
String unicode = "가나가나다라마";
assertEquals("가나가나다라마", StringHelper.readUnicode(unicode));
}
|