[C CODE] BIG5 (ascii) to UTF-8 轉碼 sample code – use iconv , libiconv

♥ ♥ ♥ 如果這頁訊息對您有幫助 請幫我點上方廣告↑ ↑ ↑ 感謝您的幫助 ♥ ♥ ♥ #include “iconv.h” #define MAX_STRING_LEN 10*1024 char tmp[MAX_STRING_LEN]; char p2[MAX_STRING_LEN]; iconv_t cd; int v1 , v2; char *sin , *sout; cd = iconv_open(“utf-8″,”big5″); if (cd==0) return -1; // —-> LOOP sin=p2; sout=tmp; v1=strlen(p2)+1; v2=MAX_STRING_LEN; if ( !iconv(cd,&sin,&v1,&sout,&v2) ) strcpy(dat[26],tmp); else strcpy(dat[26],”Error”); // —-> LOOP END […]