Skip to content

Issue with zip headers general purpose flags bit 11 for OPC packages. #87658

Closed
@tomjebo

Description

@tomjebo

Description

This is from dotnet/Open-XML-SDK#1443

The problem is that when using .net core to create a new archive, bit 11 of the general purpose flags is set and this is not supported by the ISO 29500-2 OPC standard that is used by Office Open XML (i.e. Office documents). This makes Office documents created by the Open XML SDK or any code that uses System.IO.Compression or Packaging, non-compliant for ISO 29500-2.

The general purpose flags are described here:
http://www.pkware.com/documents/APPNOTE/APPNOTE_6.2.0.txt

Reproduction Steps

Using the Open XML SDK to reproduce this can be simple:

using System.IO.Packaging;

// Create a document by supplying the filepath.
using (WordprocessingDocument wordDocument = WordprocessingDocument.Create(args[0], WordprocessingDocumentType.Document))

...

wordDocument.Save();

Target .Net 7.0, 6.0, 5.0

Expected behavior

Bit 11 should not be set. ISO 29500-2 OPC standard Annex C. (normative) ZIP Appnote.txt Clarifications contains Table C–5. "Support for modes/structures defined by general purpose bit flags" which details the supported and non-supported bit flags. For the purpose of fixing this, turning off bit 11 would suffice.

Actual behavior

Bit 11 is toggle to 1.

Regression?

I verified that .Net Framework does not turn on bit 11 in the same scenario with the test code above.

Known Workarounds

None

Configuration

.Net 7.0
Visual Studio 2022
Open XML SDK (using System.IO.Packaging)
C#
Windows 11

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions