class UnicodeToChar
{
public void unicodeToChar()
{
String[] rawUnicode ="\uc548\ub155\ud558\uc138\uc694".split("");
int intVal
= 0;
char[]
chVal;
System.out.print("(HEX)" + "\t" + "(INT)" + "\t" +"(Decoded)");
// StringBuffer sb = new
StringBuffer(6);
for (int i = 0;
i < rawUnicode.length; i++){
chVal =
rawUnicode[i].toCharArray();
for(int j = 0;
j < chVal.length; j++){
intVal = chVal[j];
//
sb.append("\\u").append(Integer.toHexString(intVal));
// System.out.println("###
sb.toString()" + sb.toString());
System.out.print(Integer.toHexString(intVal)
+ "\t" + intVal + "\t" +
chVal[j]);
}
System.out.println();
}
}
}
/*
(HEX) (INT)
(Decoded)
c548 50504
안
b155 45397
녕
d558 54616
하
c138 49464
세
c694 50836
요
*/
댓글 없음:
댓글 쓰기