1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-20 10:13:17 +00:00

Added UTF8 support to zip reader/writer

This commit is contained in:
Bryan Roe
2022-02-01 20:14:29 -08:00
parent 47b99608cf
commit 11d13ce251
3 changed files with 13 additions and 4 deletions

View File

@@ -377,10 +377,19 @@ function read(path)
var efLength = buffer.readUInt16LE(30);
var comLength = buffer.readUInt16LE(32);
var name = buffer.slice(46, 46 + nameLength).toString();
var namebuf = buffer.slice(46, 46 + nameLength);
var efs = (buffer.readUInt16LE(8) & 2048) == 2048;
console.info1('Central Directory Record:');
console.info1(' Version: ' + buffer.readUInt16LE(4));
console.info1(' Minimum: ' + buffer.readUInt16LE(6));
console.info1(' General Purpose Flags: ' + buffer.readUInt16LE(8));
console.info1(' EFS: ' + efs);
if (efs)
{
console.info1(' => ' + namebuf.toString('hex'));
console.info1(' E6B8ACE8A9A6E69687E4BBB62E6C6F67');
}
console.info1(' Name: ' + name);
console.info1(' CRC-32 of Uncompressed data: ' + buffer.readUInt32LE(16));
console.info1(' Uncompressed Size: ' + buffer.readUInt32LE(24));