Rhynio
Files & technology

ZIP filenames garbled? Compare the declaration with the bytes

The same ZIP can show readable names in one reader and gibberish in another. Compare its filename bytes, UTF-8 flag and Unicode Path metadata to decide what is known before choosing an override.

A missing UTF-8 flag does not identify the encoding

Keep an unchanged copy of the original ZIP. A reader may apply a fallback or a heuristic when the encoding is unclear; readable output is useful evidence, but it cannot by itself prove the sender’s intended name. Ask the sender to confirm an example when several readings remain plausible.

Separate three questions: what bytes were stored, what metadata declares, and what name was intended. Installing a language pack does not supply missing archive metadata. If the correct characters are present but drawn as boxes, investigate font display separately.

One intended name, four metadata cases

These are synthetic examples whose creator intended 日本.txt. A recipient would not automatically know that intention. Each entry has an empty stored file; local and central headers agree in A–D. Flags below are shown as local / central.

Compare raw bytes, metadata and justified conclusions
Case and raw filename bytes (hex)Flags and Unicode PathPossible interpretation and conclusion
A. UTF-8 declarede6 97 a5 e6 9c ac 2e 74 78 740x0800 / 0x0800

Absent

UTF-8 → 日本.txt

The flag declares UTF-8. These bytes satisfy that declaration.
B. Same bytes, no flage6 97 a5 e6 9c ac 2e 74 78 740x0000 / 0x0000

Absent

UTF-8 → 日本.txt; a fallback can display something else.

UTF-8 is a candidate interpretation, not a declaration. The absent flag does not select Shift_JIS.
C. Legacy bytes, matching Unicode field93 fa 96 7b 2e 74 78 740x0000 / 0x0000

0x7075; version 1; CRC32 E2857336 (matches)

Shift_JIS → 日本.txt; UnicodeName → 日本.txt

The matching field supplies a Unicode name linked to these raw bytes. It does not declare the legacy code page.
D. Same legacy bytes, stale CRC93 fa 96 7b 2e 74 78 740x0000 / 0x0000

0x7075; version 1; CRC32 E2857337 (does not match)

Shift_JIS → 日本.txt remains a candidate; the extra field also says 日本.txt.

Ignore the stale Unicode Path field even though its text looks right. The intended name remains unconfirmed without other evidence.

A and B have identical filename bytes. Only bit 11 changes in both headers. C and D have identical legacy bytes and Unicode text; only the extra field’s stored CRC differs.

Read bit 11 as a declaration

The language encoding flag has mask 0x0800. Test that bit within the whole flags value, rather than requiring the flags to equal 0x0800. In a little-endian header, that mask is stored as bytes 00 08.

APPNOTE Appendix D specifies UTF-8 names and comments when bit 11 is set; without it, the original ZIP encoding (CP437) is expected. Real producers can depart from that expectation, as case B illustrates. Valid UTF-8 is a byte-pattern test, not proof of intended language. The flag says nothing about the encoding of the file’s contents. PKWARE APPNOTE 6.3.10, Appendix D.

For example, a UTF-8 declaration paired with 93 fa 96 7b would contradict the bytes: they are invalid UTF-8. Do not silently call that a valid UTF-8 name or infer a universal repair.

Validate the Unicode Path field before using it

The Info-ZIP 0x7075 field carries a version, CRC32 of the raw filename bytes, and a UTF-8 name. Recognize the version and compare the CRC against the name in that header. An unknown version or a failed CRC means the field should not be used. This filename CRC is separate from the file-data CRC. Info-ZIP field definition, mirrored by Debian.

Case C’s complete extra field is:

75 70 0f 00 01 36 73 85 e2 e6 97 a5 e6 9c ac 2e 74 78 74
75 70
Little-endian tag 0x7075.
0f 00
15 data bytes, excluding the tag and size.
01
Version 1.
36 73 85 e2
Stored CRC32 E2857336, little-endian. Computed over all 8 raw filename bytes, including .txt.
e6 97 a5 … 74
10 UTF-8 bytes spelling 日本.txt.

Case D changes the CRC bytes to 37 73 85 e2. The checksum fails even though the UTF-8 text is unchanged. A matching CRC links the field to bytes; it is not sender authentication and does not establish a legacy code page.

Check both headers when results disagree

A ZIP entry has filename metadata in its local header and central directory. Record both when investigating a disagreement. Do not collapse contradictory metadata into a single “encoding detected” label.

Synthetic conflict E

Both headers contain A’s UTF-8 name bytes, but the local flags are 0x0800 and central flags are 0x0000. Neither has a Unicode Path field.

Conclusion: the headers disagree. A reader’s choice of header or fallback can matter. This example does not predict any named application’s behavior. A second conflict fixture changes the central raw name to other.txt; that is a name disagreement as well as a decoding question.

Use an existing metadata inspector such as zipdetails to examine records and byte values. Its documentation covers display options and limitations. This page offers no untested command recipe or arbitrary-archive parser.

Choose the next step from the evidence

  1. Record the reader and exact version. Compare the same original archive, not a newly repacked copy.
  2. Inspect a representative entry. Capture raw bytes, bit 11 and Unicode Path data from both headers. If they conflict, preserve that conflict in the support report.
  3. Compare candidate previews. Katlab and Karuzip’s guide offer existing preview workflows. Their behavior and privacy claims have not been independently tested here; review the service before selecting sensitive files.
  4. Confirm intention before changing names. A sender-confirmed name and creation context can justify trying a reader override on a copy. A Japanese-looking result alone does not prove Shift_JIS, and CP932 and Shift_JIS are not universally interchangeable.

If file contents are corrupt or text inside a document is garbled, investigate that separately. Renaming ZIP entries does not establish content integrity or repair content encoding.

Three short self-checks

Try answering first; the answers stay visible so the lesson works without scripts.

1. Case B decodes cleanly as UTF-8. Is UTF-8 declared?

Answer: no. The bytes support a UTF-8 interpretation, but neither header sets bit 11. Missing bit 11 alone must never select Shift_JIS automatically.

2. Case D’s Unicode text looks correct. Can you use that field?

Answer: ignore the stale field. Its name CRC fails. Look for other evidence or sender confirmation; do not treat attractive text as a successful metadata check.

3. One header sets bit 11 and the other does not. What do you report?

Answer: report the disagreement. Include both headers and the reader/version. Do not claim the archive has one consistent UTF-8 declaration.

Optional support record to copy into a document

Copy this outline into a local document if you want to fill it in or print it. Check print preview first; print layout has not been verified. Avoid sharing private archive paths or filenames publicly.

  • Original archive preserved; entry reference safe to share:
  • Sender-confirmed intended name, or unknown:
  • Creator tool/version and source context, or unknown:
  • Reader/version, operating system, displayed result:
  • Local header: flags, raw filename hex, 0x7075 version/CRC/name:
  • Central header: flags, raw filename hex, 0x7075 version/CRC/name:
  • CRC computed over which exact bytes; match or mismatch:
  • Header disagreements and other missing evidence:
  • Candidate interpretations; what would confirm the choice:

Suggested sender question: “What should this entry be called, and which tool and version created the original ZIP?”

Evidence and limits

Reviewed 15 November 2026. The 14 November 2024 zip.js discussion describes unflagged UTF-8 read through a fallback. 7-Zip support #409 concerns historical versions 19.00 and 21.06; Yarn issue #6771 records another report in April 2025. These are historical reports, not current compatibility guarantees.

The examples were generated and checked programmatically against the header layouts and CRC rules. Source inspection was performed by AI. No extraction application, human comprehension study, browser privacy test or platform compatibility study was performed. This guide cannot identify an arbitrary archive’s intended names.