diff -Nuar unzip-5.52/fileio.c unzip-5.52.wwd/fileio.c --- unzip-5.52/fileio.c 2007-12-26 13:16:41.000000000 +0800 +++ unzip-5.52.wwd/fileio.c 2007-12-26 13:07:47.000000000 +0800 @@ -53,6 +53,7 @@ ---------------------------------------------------------------------------*/ +#include #define __FILEIO_C /* identifies this source module */ #define UNZIP_INTERNAL @@ -2145,8 +2146,26 @@ /* translate the Zip entry filename coded in host-dependent "extended ASCII" into the compiler's (system's) internal text code page */ + /* Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, G.pInfo->HasUxAtt, (option == DS_FN_L)); + */ + { /* XYZ cp936 unzip fileio.c L 2177? Ext_ASCII_TO_Native */ + if (G.pInfo->hostnum == FS_FAT_) { + iconv_t ic; + size_t i=strlen(G.filename); + size_t j=MAXPATHLEN; + char cv[MAXPATHLEN]; + char *cv_p = cv, *gf_p = G.filename; + bzero(cv,MAXPATHLEN); + + ic = iconv_open("UTF-8","CP936"); + iconv(ic, &gf_p, &i, &cv_p, &j); + iconv_close(ic); + + strncpy(G.filename, cv, MAXPATHLEN); + } + } if (G.pInfo->lcflag) /* replace with lowercase filename */ STRLOWER(G.filename, G.filename);