Language/Java [Java] 한글을 한글 UniCode 로 변환 시키는 소스 호서아빠 2008. 10. 1. 15:42 /** * 한글을 한글 UniCode 로 변환 시키는 소스 * Myoung-Geun Jang(jangsalt@nextelecom.co.kr) * 2008. 10. 1 **/ public class CharToUnicode { public static void main(String args[]) { String str = "테스트"; char[] code = new char[100]; int[] realCode = new int[100]; for(int i=0; i < str.length(); i++) { code[i] = str.charAt(i); realCode[i] = (int)(code[i]); // System.out.println( // "The unicode of '" + code[i] + "' is \\" + "u" + // Integer.toHexString(realCode[i]).toUpperCase()); } for(int i=0; i < str.length();i++) { System.out.print("\\u" + Integer.toHexString(realCode[i]).toUpperCase()); } System.out.println(""); } }