iconv 함수 사용법.?!

iconv_t cd;
cd=iconv_open("EUC-KR", "UTF-8"); //from:EUC-KR to:UTF-8


size_t in_bytes = strlen(str), last_bytes;
char *out = (char *) malloc(ICONV_BYTES(in_bytes));
char *outp = out;
size_t out_bytes = ICONV_BYTES(in_bytes);
do {
int n;

last_bytes = in_bytes;
n = iconv(cd, (char **)&str, &in_bytes, &outp, &out_bytes);

}
} while (in_bytes > 0 && in_bytes < last_bytes);
iconv_close(cd); //문자 로케일 cd
Trackback 0 Comment 0
prev 1 ··· 240 241 242 243 244 245 246 247 248 ··· 342 next