zwStar / amd-zip

文件压缩、文件解压、zip、unzip、解决文件压缩中文乱码
Other
1 stars 1 forks source link

压缩文件夹报错 #1

Open 183181731 opened 3 years ago

183181731 commented 3 years ago

var zip = new AdmZip(); zip.addLocalFolder(dic); zip.writeZip(zip);

压缩文件夹时报错,提示 TypeError: entry.rawEntryName.copy is not a function at d:\WebstormProjects\testgitnode\node_modules\@zwg\adm-zip\zipFile.js:273:24 at Array.forEach () at Object.compressToBuffer (d:\WebstormProjects\testgitnode\node_modules\@zwg\adm-zip\zipFile.js:264:14) at Object.writeZip (d:\WebstormProjects\testgitnode\node_modules\@zwg\adm-zip\adm-zip.js:623:23) at Object. (d:\WebstormProjects\testgitnode\ttt.js:79:5) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)

183181731 commented 3 years ago

这个问题更改了zipEntry.js中的 get rawEntryName()方法的返回 return Buffer(iconv.decode(_entryName, encode)); 解决了 不过中文的文件或者文件夹打包成zip,依然会乱码。