
UConverter 클래스의 getDestinationType 메서드는 파라미터를 받지 않고, 변환된 문자열의 목적 문자셋을 반환합니다. 반환되는 값은 UCharType 형태로, 변환된 문자열이 사용할 문자셋을 나타냅니다.
예를 들어, 다음 코드는 UConverter 클래스의 getDestinationType 메서드를 사용하여 변환된 문자열의 목적 문자셋을 반환하는 방법을 보여줍니다.
#hostingforum.kr
cpp
#include
#include
int main() {
// UConverter 객체 생성
UConverter* converter = ucnv_open("UTF-8", UCNV_FROM_BCMpio);
// getDestinationType 메서드 호출
UCharType destinationType = ucnv_getDestinationType(converter);
// 반환된 목적 문자셋을 출력
if (destinationType == U_US_ASCII) {
printf("US-ASCII");
} else if (destinationType == U_UTF_8) {
printf("UTF-8");
} else {
printf("Unknown");
}
// 자원 해제
ucnv_close(converter);
return 0;
}
이 코드에서는 UConverter 클래스의 getDestinationType 메서드를 사용하여 변환된 문자열의 목적 문자셋을 반환하는 방법을 보여줍니다. 반환된 목적 문자셋은 UCharType 형태로 반환되며, 변환된 문자열이 사용할 문자셋을 나타냅니다.
2025-06-02 15:00