Core Java

[Source] Unicode To String

헤르메스의날개 2010. 10. 20. 15:27
728x90
import java.io.UnsupportedEncodingException;

public class UniToString {
    public static void main(String[] args) {
        String hexStr = "\uc544\ub984\ub2e4\uc6b4"; 
        
        String ls = null;
        try {
            ls = new String(hexStr.getBytes(), "UTF-8");
        } catch(UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        System.out.println(ls);   // 결과 : 아름다운
    }
}
728x90