
UConverter의 setDestinationEncoding 메서드는 대상 인코딩을 설정하는 데 사용됩니다.
#hostingforum.kr
java
public void setDestinationEncoding(Charset cs) {
this.destination = cs;
}
사용 방법은 다음과 같습니다.
1. UConverter 객체를 생성합니다.
2. 대상 인코딩을 설정하기 위해 setDestinationEncoding 메서드를 호출합니다.
3. 인코딩 변환을 위해 convert 메서드를 호출합니다.
#hostingforum.kr
java
UConverter converter = UConverter.open("UTF-8");
converter.setDestinationEncoding(Charset.forName("EUC-KR"));
String result = converter.convert("Hello, World!");
System.out.println(result);
이 예제에서는 UTF-8 인코딩에서 EUC-KR 인코딩으로의 변환을 수행합니다.
2025-05-06 23:48