adm-zip
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
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.
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...