@@ -309,7 +309,7 @@ function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe
309
309
// version made by 2 bytes
310
310
zip64EocdrBuffer . writeUInt16LE ( VERSION_MADE_BY , 12 ) ;
311
311
// version needed to extract 2 bytes
312
- zip64EocdrBuffer . writeUInt16LE ( VERSION_NEEDED_TO_EXTRACT , 14 ) ;
312
+ zip64EocdrBuffer . writeUInt16LE ( VERSION_NEEDED_TO_EXTRACT_ZIP64 , 14 ) ;
313
313
// number of this disk 4 bytes
314
314
zip64EocdrBuffer . writeUInt32LE ( 0 , 16 ) ;
315
315
// number of the disk with the start of the central directory 4 bytes
@@ -421,8 +421,8 @@ Entry.prototype.useZip64Format = function() {
421
421
) ;
422
422
}
423
423
var LOCAL_FILE_HEADER_FIXED_SIZE = 30 ;
424
- // this version enables zip64
425
- var VERSION_NEEDED_TO_EXTRACT = 45 ;
424
+ var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20 ;
425
+ var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45 ;
426
426
// 3 = unix. 63 = spec version 6.3
427
427
var VERSION_MADE_BY = ( 3 << 8 ) | 63 ;
428
428
var FILE_NAME_IS_UTF8 = 1 << 11 ;
@@ -444,7 +444,7 @@ Entry.prototype.getLocalFileHeader = function() {
444
444
// local file header signature 4 bytes (0x04034b50)
445
445
fixedSizeStuff . writeUInt32LE ( 0x04034b50 , 0 ) ;
446
446
// version needed to extract 2 bytes
447
- fixedSizeStuff . writeUInt16LE ( VERSION_NEEDED_TO_EXTRACT , 4 ) ;
447
+ fixedSizeStuff . writeUInt16LE ( VERSION_NEEDED_TO_EXTRACT_UTF8 , 4 ) ;
448
448
// general purpose bit flag 2 bytes
449
449
fixedSizeStuff . writeUInt16LE ( generalPurposeBitFlag , 6 ) ;
450
450
// compression method 2 bytes
@@ -513,11 +513,13 @@ Entry.prototype.getCentralDirectoryRecord = function() {
513
513
var normalCompressedSize = this . compressedSize ;
514
514
var normalUncompressedSize = this . uncompressedSize ;
515
515
var normalRelativeOffsetOfLocalHeader = this . relativeOffsetOfLocalHeader ;
516
+ var versionNeededToExtract ;
516
517
var zeiefBuffer ;
517
518
if ( this . useZip64Format ( ) ) {
518
519
normalCompressedSize = 0xffffffff ;
519
520
normalUncompressedSize = 0xffffffff ;
520
521
normalRelativeOffsetOfLocalHeader = 0xffffffff ;
522
+ versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64 ;
521
523
522
524
// ZIP64 extended information extra field
523
525
zeiefBuffer = new Buffer ( ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE ) ;
@@ -534,6 +536,7 @@ Entry.prototype.getCentralDirectoryRecord = function() {
534
536
// Disk Start Number 4 bytes Number of the disk on which this file starts
535
537
// (omit)
536
538
} else {
539
+ versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8 ;
537
540
zeiefBuffer = new Buffer ( 0 ) ;
538
541
}
539
542
@@ -542,7 +545,7 @@ Entry.prototype.getCentralDirectoryRecord = function() {
542
545
// version made by 2 bytes
543
546
fixedSizeStuff . writeUInt16LE ( VERSION_MADE_BY , 4 ) ;
544
547
// version needed to extract 2 bytes
545
- fixedSizeStuff . writeUInt16LE ( VERSION_NEEDED_TO_EXTRACT , 6 ) ;
548
+ fixedSizeStuff . writeUInt16LE ( versionNeededToExtract , 6 ) ;
546
549
// general purpose bit flag 2 bytes
547
550
fixedSizeStuff . writeUInt16LE ( generalPurposeBitFlag , 8 ) ;
548
551
// compression method 2 bytes
0 commit comments