Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Seeking help with Extracting files from zip

by Anonymous Monk
on Jan 14, 2015 at 18:09 UTC ( [id://1113254]=note: print w/replies, xml ) Need Help??


in reply to Seeking help with Extracting files from zip

What do members look like? (when you print them out to a file)
  • Comment on Re: Seeking help with Extracting files from zip

Replies are listed 'Best First'.
Re^2: Seeking help with Extracting files from zip
by pmqs (Friar) on Jan 14, 2015 at 19:33 UTC
    Here is an example of the output I get when with a zip file that uses Unicode properly. The important thing to look for is the presence of the "Language Encoding".
    0000 LOCAL HEADER #1 04034B50 0004 Extract Zip Spec 0A '1.0' 0005 Extract OS 00 'MS-DOS' 0006 General Purpose Flag 0800 [Bit 11] 1 'Language Encoding' 0008 Compression Method 0000 'Stored' 000A Last Mod Time 3EB3B54C 'Thu May 19 22:42:24 2011' 000E CRC 00000000 0012 Compressed Length 00000000 0016 Uncompressed Length 00000000 001A Filename Length 0009 001C Extra Length 001C 001E Filename 'tmp/PĀé' 0027 Extra ID #0001 5455 'UT: Extended Timestamp' 0029 Length 0009 002B Flags '03 mod access' 002C Mod Time 4DD58EBF 'Thu May 19 22:42:23 2011' 0030 Access Time 4DD59079 'Thu May 19 22:49:45 2011' 0034 Extra ID #0002 7875 'ux: Unix Extra Type 3' 0036 Length 000B 0038 Version 01 0039 UID Size 04 003A UID 000003E8 003E GID Size 04 003F GID 000003E8 0043 CENTRAL HEADER #1 02014B50 0047 Created Zip Spec 1E '3.0' 0048 Created OS 03 'Unix' 0049 Extract Zip Spec 0A '1.0' 004A Extract OS 00 'MS-DOS' 004B General Purpose Flag 0800 [Bit 11] 1 'Language Encoding' 004D Compression Method 0000 'Stored' 004F Last Mod Time 3EB3B54C 'Thu May 19 22:42:24 2011' 0053 CRC 00000000 0057 Compressed Length 00000000 005B Uncompressed Length 00000000 005F Filename Length 0009 0061 Extra Length 0018 0063 Comment Length 0000 0065 Disk Start 0000 0067 Int File Attributes 0000 [Bit 0] 0 'Binary Data' 0069 Ext File Attributes 81A40000 006D Local Header Offset 00000000 0071 Filename 'tmp/PĀé' 007A Extra ID #0001 5455 'UT: Extended Timestamp' 007C Length 0005 007E Flags '03 mod access' 007F Mod Time 4DD58EBF 'Thu May 19 22:42:23 2011' 0083 Extra ID #0002 7875 'ux: Unix Extra Type 3' 0085 Length 000B 0087 Version 01 0088 UID Size 04 0089 UID 000003E8 008D GID Size 04 008E GID 000003E8 0092 END CENTRAL HEADER 06054B50 0096 Number of this disk 0000 0098 Central Dir Disk no 0000 009A Entries in this disk 0001 009C Total Entries 0001 009E Size of Central Dir 0000004F 00A2 Offset to Central Dir 00000043 00A6 Comment Length 0000 Done
      Actually, if you run zipdetails in verbose mode we can get a hex dump of what is actually stored in the zip file. The "-v" option enables verbose mode below
      $ zipdetails -v abc.zip 0000 0004 50 4B 03 04 LOCAL HEADER #1 04034B50 0004 0001 0A Extract Zip Spec 0A '1.0' 0005 0001 00 Extract OS 00 'MS-DOS' 0006 0002 00 08 General Purpose Flag 0800 [Bit 11] 1 'Language Encoding' 0008 0002 00 00 Compression Method 0000 'Stored' 000A 0004 4C B5 B3 3E Last Mod Time 3EB3B54C 'Thu May 19 22:42 +:24 2011' 000E 0004 00 00 00 00 CRC 00000000 0012 0004 00 00 00 00 Compressed Length 00000000 0016 0004 00 00 00 00 Uncompressed Length 00000000 001A 0002 09 00 Filename Length 0009 001C 0002 1C 00 Extra Length 001C 001E 0009 74 6D 70 2F Filename 'tmp/PĀé' 50 C4 80 C3 A9 0027 0002 55 54 Extra ID #0001 5455 'UT: Extended Timesta +mp' 0029 0002 09 00 Length 0009 002B 0001 03 Flags '03 mod access' 002C 0004 BF 8E D5 4D Mod Time 4DD58EBF 'Thu May 19 22:42 +:23 2011' 0030 0004 79 90 D5 4D Access Time 4DD59079 'Thu May 19 22:49 +:45 2011' 0034 0002 75 78 Extra ID #0002 7875 'ux: Unix Extra Type +3' 0036 0002 0B 00 Length 000B 0038 0001 01 Version 01 0039 0001 04 UID Size 04 003A 0004 E8 03 00 00 UID 000003E8 003E 0001 04 GID Size 04 003F 0004 E8 03 00 00 GID 000003E8 0043 0004 50 4B 01 02 CENTRAL HEADER #1 02014B50 0047 0001 1E Created Zip Spec 1E '3.0' 0048 0001 03 Created OS 03 'Unix' 0049 0001 0A Extract Zip Spec 0A '1.0' 004A 0001 00 Extract OS 00 'MS-DOS' 004B 0002 00 08 General Purpose Flag 0800 [Bit 11] 1 'Language Encoding' 004D 0002 00 00 Compression Method 0000 'Stored' 004F 0004 4C B5 B3 3E Last Mod Time 3EB3B54C 'Thu May 19 22:42 +:24 2011' 0053 0004 00 00 00 00 CRC 00000000 0057 0004 00 00 00 00 Compressed Length 00000000 005B 0004 00 00 00 00 Uncompressed Length 00000000 005F 0002 09 00 Filename Length 0009 0061 0002 18 00 Extra Length 0018 0063 0002 00 00 Comment Length 0000 0065 0002 00 00 Disk Start 0000 0067 0002 00 00 Int File Attributes 0000 [Bit 0] 0 'Binary Data' 0069 0004 00 00 A4 81 Ext File Attributes 81A40000 006D 0004 00 00 00 00 Local Header Offset 00000000 0071 0009 74 6D 70 2F Filename 'tmp/PĀé' 50 C4 80 C3 A9 007A 0002 55 54 Extra ID #0001 5455 'UT: Extended Timesta +mp' 007C 0002 05 00 Length 0005 007E 0001 03 Flags '03 mod access' 007F 0004 BF 8E D5 4D Mod Time 4DD58EBF 'Thu May 19 22:42 +:23 2011' 0083 0002 75 78 Extra ID #0002 7875 'ux: Unix Extra Type +3' 0085 0002 0B 00 Length 000B 0087 0001 01 Version 01 0088 0001 04 UID Size 04 0089 0004 E8 03 00 00 UID 000003E8 008D 0001 04 GID Size 04 008E 0004 E8 03 00 00 GID 000003E8 0092 0004 50 4B 05 06 END CENTRAL HEADER 06054B50 0096 0002 00 00 Number of this disk 0000 0098 0002 00 00 Central Dir Disk no 0000 009A 0002 01 00 Entries in this disk 0001 009C 0002 01 00 Total Entries 0001

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found