포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 20MB 입니다.

컴파일은 안 해봤지만, 아마도 큰 문제는 없을 것임.....^^
====================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iconv.h>
#include <errno.h>


static iconv_t conv_desc; 

char utf8buf[2048];

char* euckr_to_utf8( const char* str, int in_strlen, int out_strlen )
{
    char *outbuf;
    int err;
   
    memset(utf8buf, 0x00, sizeof(utf8buf) );
    outbuf = utf8buf;

    err = iconv( cd, (char**)&str, &in_strlen, &outbuf, &out_strlen );
    if( err < 0 )
    {
     printf("iconv errorn");
     return NULL;
    }

    return outbuf;
}

int main(void)
{
 char *ghc = "바보";
 char *utf8;
 
 int inlen;
 
    conv_desc = iconv_open( "UTF-8", "EUC-KR" );
    if( conv_desc < 0)
    {
     printf ("iconv_open failed!n");
    }
   
    inlen = strlen(ghc);
   
    utf8 = euckr_to_utf8(ghc, inlen, inlen*2 );
    if( utf8 == NULL )
    {
     printf("euckr_to_utf8 errorn");
     return -1;
    }

 printf("utf8 = %sn", utf8);
   
    iconv_close( conv_desc );
   
    return -1;
}   
   

List of Articles
번호 제목 글쓴이 날짜 조회 수sort
53 wxWidget sample program 올리기 - windows/linux file 고도리 2008-07-18 6935
52 devcpp howto입니다.(devcpp/wxWidget/SDL) file 고도리 2008-07-18 6915
51 펌웨어 프로그래밍 팁 - atoi() 함수 구현 김재훈 2009-01-31 6801
50 windows/linux에서 작업했던 tutorial입니다. file 고도리 2008-07-18 6626
49 wxWidget odbc file 고도리 2008-07-18 6565
48 wxWidget hello unix example file 고도리 2008-07-18 6494
47 SDL tslib initialize 고현철 2009-04-09 6426
» iconv euckr_to_utf8 고현철 2009-01-30 6418
45 Embedded Linux Debugging HowTo file 김재훈 2009-04-27 6396
44 우분투 리눅스 8.10 네트워크 수동 설정 방법 [2] 김재훈 2009-03-23 6367
43 유용한 ARM 어셈블리 (if, for, do_while, switch) 김재훈 2009-01-31 6332
42 vi 사용법 - block 지정 고현철 2009-01-30 6303
41 find 명령어 활용법 고현철 2009-01-30 6272
40 VirtualBox 설치 및 환경 설정 가이드 file 김재훈 2009-03-23 6267
39 ARM 7 강좌를 다른 분이 편집한 자료 같네요. file [2] 황순일 2007-12-13 6228
38 펌웨어 프로그래밍 팁 - atox() 함수 구현 김재훈 2009-01-31 6209
37 limxml2 라이브러리를 이용해서 어트리뷰트 값을 가져오는 방법 고현철 2009-01-30 6208
36 유용한 ARM 어셈블리 분기 명령어 시리즈 #2 김재훈 2009-01-31 6146
35 우분투 리눅스 8.10 업데이트 서버 변경 방법 김재훈 2009-03-23 6144
34 응용프로그램 컴파일 시 "config.h"가 없다고 나오는 경우 [1] 김재훈 2009-02-18 6137

사용자 로그인