adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

The zip data is not the same with `toBuffer` and `writeZip` when there are unicode characters in the file names

Open zwz opened this issue 4 years ago • 1 comments

Here is my code:

const zipfile = new AdmZip();

zipfile.addLocalFile('test.txt');
...   // add other local files 

zipfile.writeZip('test.zip');
var buf = fs.readFileSync('test.zip')
zipfile.toBuffer(function(buffer){
          if(buf.toString() != buffer.toString()){
                 console.log('Error, not the same!!!!!')
}

Everything works as expected, until I add into the zip an empty file which has Chinese characters in the filename zipfile.addLocalFile('test副本.txt');

It says Error, not the same!!!!!. And if I remove this file, it says nothing.

zwz avatar Sep 05 '21 05:09 zwz

I've encountered a similar problem when zipping a folder that contained several CSV files. Japanese characters used in a CSV file name disappeared, though ones in a file were kept intact. Still trying to find workarounds...

tinytortoise-dev avatar Aug 21 '23 03:08 tinytortoise-dev