Skip to content

Appendix D: Compatibility ​

This appendix documents compatibility considerations with 7-Zip and other implementations.

7-Zip Versions ​

Version History ​

VersionReleaseNotable Changes
9.202010Stable baseline
15.062015ARM64 filter
18.012018LZMA2 improvements
19.002019Encryption improvements
21.002021Performance improvements
22.002022Bug fixes
23.002023RISC-V filter
24.002024Current stable

Baseline Compatibility ​

For maximum compatibility, target 7-Zip 9.20 features:

  • LZMA, LZMA2 compression
  • BCJ filters (x86, ARM, PPC, IA64, SPARC)
  • Delta filter
  • AES-256 encryption
  • Solid and non-solid modes

Implementation Differences ​

p7zip ​

Fork of 7-Zip for Unix/Linux:

  • Same format support as 7-Zip
  • May lag behind in new features
  • Development less active since 2016

7-Zip-zstd ​

Fork with additional compression methods:

  • Zstandard (zstd)
  • Brotli
  • LZ4, LZ5, Lizard

Note: Archives using these methods require compatible tools.

py7zr ​

Python implementation:

  • No BCJ2 support
  • No Deflate64 support
  • UTF-8 symlink targets

libarchive ​

Multi-format library:

  • Zstandard support
  • Some edge cases handled differently

Known Quirks ​

File Name Encoding ​

7-Zip always uses UTF-16-LE for file names. Some implementations:

  • May produce invalid UTF-16 for certain characters
  • Handle surrogate pairs differently
  • Normalize paths differently

Recommendation: Validate UTF-16 when reading, produce valid UTF-16 when writing.

Timestamp Precision ​

7-Zip stores full FILETIME precision (100ns). Some implementations:

  • Truncate to second precision
  • Lose sub-second information
  • Use different epoch conversions

Recommendation: Preserve full precision when possible.

Unix Attributes ​

The UNIX_EXTENSION flag (bit 15) usage varies:

  • Some tools always set it on Unix
  • Some only when permissions differ from default
  • Windows 7-Zip ignores it

Recommendation: Set UNIX_EXTENSION when storing Unix-specific attributes.

Empty Files vs Directories ​

Distinction relies on EmptyFile property:

  • If EmptyStream but not EmptyFile → directory
  • Some tools mark empty files incorrectly

Recommendation: Also check DIRECTORY attribute (0x10) for robustness.

Solid Block Sizes ​

Different tools use different solid block size defaults:

  • 7-Zip GUI: Configurable
  • Command line: Various defaults
  • Other tools: Often "solid" or "non-solid" only

Recommendation: Document solid block size when relevant.

Interoperability Testing ​

Test Archive Sources ​

  1. Create archives with 7-Zip
  2. Create archives with p7zip
  3. Download test archives from py7zr repository

Test Scenarios ​

ScenarioTest
Basic extractionExtract 7-Zip created archive
Compression methodsTest all common methods
Solid archivesExtract from solid blocks
EncryptionVarious passwords and settings
Unicode namesNon-ASCII characters
Long pathsPaths > 260 characters
Symbolic linksUnix and Windows styles
Empty filesZero-byte files
DirectoriesVarious attributes

Validation Checklist ​

  • [ ] CRCs match
  • [ ] File sizes correct
  • [ ] Timestamps preserved
  • [ ] Attributes correct
  • [ ] Paths correct
  • [ ] Symlinks point to correct targets

Writing Compatible Archives ​

For maximum compatibility:

Compression: LZMA2
Dictionary: 16 MiB or less
Solid: Off (or small blocks)
Header compression: LZMA2
Header encryption: Off
Filters: BCJ for executables only

Settings to Avoid ​

These reduce compatibility:

SettingCompatibility Impact
Zstd, Brotli, LZ4Requires 7-Zip-zstd
Very large dictionaryMemory issues on 32-bit
BCJ2py7zr cannot read
Deflate64Some tools read-only
Very long solid blocksMemory during extraction

Error Messages ​

Common Errors from Other Tools ​

ErrorLikely Cause
"Unsupported method"Extended compression (zstd, etc.)
"Data error"Corruption or wrong password
"CRC failed"Corruption
"Unexpected end"Truncated archive
"Headers error"Header corruption

Our Errors for Their Archives ​

ConditionAppropriate Response
Unknown methodSkip entry with warning
Invalid UTF-16Replace invalid chars
Future versionWarn and attempt read
Missing CRCsProceed without verification

Multi-Volume Compatibility ​

Naming ​

Standard: .7z.001, .7z.002, etc.

Some tools use:

  • .7z.1, .7z.2 (no padding)
  • .001, .002 (base name only)
  • .part1.7z, .part2.7z (alternative)

Recommendation: Accept standard naming, produce standard naming.

Splitting Boundaries ​

7-Zip splits at configured size. When joining:

  • Read volumes in order
  • Verify all present before extraction
  • Handle missing volumes gracefully

SFX Compatibility ​

Stubs ​

7-Zip provides Windows stubs. For other platforms:

  • Linux: Community-created stubs
  • macOS: Manual stub creation

Config Block ​

7-Zip's config format is Windows-centric. Cross-platform SFX:

  • May not support all options
  • May ignore GUI settings on non-Windows

Future Compatibility ​

Reserved Fields ​

  • Reserved flag bits: Always write as 0
  • Unknown properties: Skip by size
  • Unknown methods: Report and skip

Version Handling ​

  • Major version > 0: Reject
  • Minor version > 4: Warn but attempt

Community Resources ​

Test Archives ​

  • py7zr test data: Various edge cases
  • 7-Zip test suite: Official tests
  • libarchive tests: Multi-format tests

Implementation References ​

  • 7-Zip source: Authoritative
  • py7zr: Well-documented Python
  • sevenz-rust2: Another Rust implementation

See Also ​

Released under MIT OR Apache-2.0 License