16진수 변환

URLEncdoe 와 URLDecode 를 만들 수 있겠습니다.

public class Example {
  public static void main(String[] args) {



    // 한글을 16진수로 변환 출력
    System.out.format(“%04X%n”, (int) ‘가’);
    // 출력 결과: AC00



    // 16진수를 한글로 변환 출력
    System.out.format(“%c%n”, (char) 0xAC00);
    // 출력 결과: 가



    // 출력 결과를 화면이 아닌 변수에 저장하여 완전 변환 방법
    String s = String.format(“%c”, (char) 0xAC00);
    System.out.println(s);
    // 가


  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *