Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:19:10+00:00 2026-06-14T00:19:10+00:00

I recently wrote a zip file I/O library called zipzap , but I’m struggling

  • 0

I recently wrote a zip file I/O library called zipzap, but I’m struggling with correctly decoding zip entry file names from arbitrary zip files.

Now, the PKWARE spec states:

D.1 The ZIP format has historically supported only the original IBM PC character
encoding set, commonly referred to as IBM Code Page 437…

D.2 If general purpose bit 11 is unset, the file name and comment should conform
to the original ZIP character encoding. If general purpose bit 11 is set, the
filename and comment must support The Unicode Standard, Version 4.1.0 or
greater using the character encoding form defined by the UTF-8 storage
specification…

which means that conforming zip files encode file names as CP437, unless the EFS bit is set, in which case the file names are UTF-8.

Unfortunately it seems that a lot of zip tools either don’t set the EFS bit correctly (e.g. Mac CLI, GUI zip) or use some other encoding, typically the default system one (e.g. WinZip?). If you know how WinZip, 7-Zip, Info-Zip, PKZIP, Java JAR/Zip, .NET zip, dotnetzip, etc. encode file names and what they set their “version made by” field to when zipping, please tell me.

In particular, Info-Zip tries this when unzipping:

  • File system = MS-DOS (0) => CP437
    • except: version = 2.5, 2.6, 4.0 => ISO 8859-1
  • File system = HPFS (6) => CP437
  • File system = NTFS (10) and version = 5.0 => CP437
  • otherwise, ISO 8859-1

If I want to support inspecting or extracting from arbitrary zip files and make a reasonable attempt at the file name encoding without the EFS flag, what can I look for?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:19:12+00:00Added an answer on June 14, 2026 at 12:19 am

    The only way to determine if the filename is encoded as UTF-8 without using the EFS flag is to check to see if the high order bit is set in one of the characters. That could possibly mean that the character is UTF-8 encoded. However, it could still be the other way as there are some characters in CP437 that have the high order bit set and aren’t meant to be decoded as UTF-8.

    I would stick to the PKWARE app note specification and not hack in a solution that tries to conform to every known zip application in existence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote a simple utility in Perl to count words in a file
I recently wrote a couple of map/reduce programs in java. But I also know
I recently wrote a small app which will grab contacts from microsoft Outlook and
I recently wrote code that didnt work as i would expect, it was: message
I recently wrote a program that used a simple producer/consumer pattern. It initially had
I recently wrote some data access methods (plain old Java) that use immutable objects
I recently wrote a theme function to add a class to my primary links
I recently wrote a script which queries PyPI and downloads a package; however, the
I recently wrote a custom Debugger Visualizer for Visual Studio 2008 for one of
So I recently wrote a java class that extends exception and used an instance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.