[PR #363] [MERGED] ZipArchive Reader: Uses IBM PC character encoding to decode filename … #987

Closed
opened 2026-01-29 22:18:29 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/363
Author: @sridhar6668
Created: 3/27/2018
Status: Merged
Merged: 5/5/2018
Merged by: @adamhathcock

Base: masterHead: sridhar6668/support_extended_ascii


📝 Commits (7)

  • 04ba6c2 ZipArchive Reader: Uses IBM PC character encoding to decode filename and comment if the general purpose bit 11 is not set in the header
  • 5d8728d Decode without setting the default Encoding type
  • 1ea7bb5 Merge branch 'master' into sridhar6668/support_extended_ascii
  • 91d753c Merge branch 'master' into sridhar6668/support_extended_ascii
  • abddabf Proper fixes for all platforms
  • 501407c Change flag name to be closer to spec
  • 2fb31d4 Merge branch 'master' into sridhar6668/support_extended_ascii

📊 Changes

8 files changed (+3552 additions, -9 deletions)

View changed files

reference/APPNOTE.TXT (+3497 -0)
📝 src/SharpCompress/Common/ArchiveEncoding.cs (+17 -0)
📝 src/SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs (+16 -4)
📝 src/SharpCompress/Common/Zip/Headers/HeaderFlags.cs (+2 -1)
📝 src/SharpCompress/Common/Zip/Headers/LocalEntryHeader.cs (+11 -1)
📝 src/SharpCompress/SharpCompress.csproj (+7 -1)
📝 src/SharpCompress/Writers/Zip/ZipCentralDirectoryEntry.cs (+1 -1)
📝 src/SharpCompress/Writers/Zip/ZipWriter.cs (+1 -1)

📄 Description

According to the zip file format specification, if general purpose bit 11 is unset, the file name and comment should conform to the original ZIP character encoding(IBM PC character encoding set, commonly referred to as IBM Code Page 437.). If general purpose bit 11 is set, the filename and comment must support UTF8.

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT . Heading - Language Encoding

Currently, the library always uses UTF8 to decode names. This pull request will use IBM PC character encoding if the UTF8 flag is not set in the header


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/363 **Author:** [@sridhar6668](https://github.com/sridhar6668) **Created:** 3/27/2018 **Status:** ✅ Merged **Merged:** 5/5/2018 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `sridhar6668/support_extended_ascii` --- ### 📝 Commits (7) - [`04ba6c2`](https://github.com/adamhathcock/sharpcompress/commit/04ba6c2d735d7c69c18812d014a49645ca3f143e) ZipArchive Reader: Uses IBM PC character encoding to decode filename and comment if the general purpose bit 11 is not set in the header - [`5d8728d`](https://github.com/adamhathcock/sharpcompress/commit/5d8728d5923276bfc98575cc0810f500178a521e) Decode without setting the default Encoding type - [`1ea7bb5`](https://github.com/adamhathcock/sharpcompress/commit/1ea7bb57e51fbf0761b7f24cf417c3c0aba3c3f8) Merge branch 'master' into sridhar6668/support_extended_ascii - [`91d753c`](https://github.com/adamhathcock/sharpcompress/commit/91d753cbdb8e630995b4f8370a56181237fbc84a) Merge branch 'master' into sridhar6668/support_extended_ascii - [`abddabf`](https://github.com/adamhathcock/sharpcompress/commit/abddabf18e5402ac37ebaebc3d6a880a14aacfe8) Proper fixes for all platforms - [`501407c`](https://github.com/adamhathcock/sharpcompress/commit/501407c3fe2ec7faa27788a9419ffec9423ddd8e) Change flag name to be closer to spec - [`2fb31d4`](https://github.com/adamhathcock/sharpcompress/commit/2fb31d4b84d2213c1dcef6bae0adb16e6f15ded0) Merge branch 'master' into sridhar6668/support_extended_ascii ### 📊 Changes **8 files changed** (+3552 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `reference/APPNOTE.TXT` (+3497 -0) 📝 `src/SharpCompress/Common/ArchiveEncoding.cs` (+17 -0) 📝 `src/SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs` (+16 -4) 📝 `src/SharpCompress/Common/Zip/Headers/HeaderFlags.cs` (+2 -1) 📝 `src/SharpCompress/Common/Zip/Headers/LocalEntryHeader.cs` (+11 -1) 📝 `src/SharpCompress/SharpCompress.csproj` (+7 -1) 📝 `src/SharpCompress/Writers/Zip/ZipCentralDirectoryEntry.cs` (+1 -1) 📝 `src/SharpCompress/Writers/Zip/ZipWriter.cs` (+1 -1) </details> ### 📄 Description According to the zip file format specification, if general purpose bit 11 is unset, the file name and comment should conform to the original ZIP character encoding(IBM PC character encoding set, commonly referred to as IBM Code Page 437.). If general purpose bit 11 is set, the filename and comment must support UTF8. https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT . Heading - Language Encoding Currently, the library always uses UTF8 to decode names. This pull request will use IBM PC character encoding if the UTF8 flag is not set in the header --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:18:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#987