[PR #696] [MERGED] Ignores UnicodePathExtra if forced encoding is specified #1170

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/696
Author: @stakira
Created: 9/15/2022
Status: Merged
Merged: 9/15/2022
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (1)

  • 418c125 Ignores UnicodePathExtra if forced encoding is specified

📊 Changes

4 files changed (+34 additions, -2 deletions)

View changed files

📝 src/SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs (+1 -1)
📝 src/SharpCompress/Common/Zip/Headers/LocalEntryHeader.cs (+1 -1)
📝 tests/SharpCompress.Test/Zip/ZipArchiveTests.cs (+32 -0)
tests/TestArchives/Archives/Zip.UnicodePathExtra.zip (+0 -0)

📄 Description

  • It may be surprising, but probably due to the history of Windows, it is not unusual to encounter zip files compressed with wrong unicode path info.
  • My program provides a UI for users to preview decoded paths and choose a proper encoding before extracting. However, UnicodePathExtra always overriding specified encoding makes this impossible for some files.
  • Forced encoding doesn't seem to be used anywhere, other than shadowing Default. That basically makes the two fields equivalent. Shouldn't it override UnicodePathExtra? Anyway, I think this is the intended behavior, instead of the current one.

🔄 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/696 **Author:** [@stakira](https://github.com/stakira) **Created:** 9/15/2022 **Status:** ✅ Merged **Merged:** 9/15/2022 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`418c125`](https://github.com/adamhathcock/sharpcompress/commit/418c1256a8513a1c8f9c455fd0c4ae1ea0b84279) Ignores UnicodePathExtra if forced encoding is specified ### 📊 Changes **4 files changed** (+34 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs` (+1 -1) 📝 `src/SharpCompress/Common/Zip/Headers/LocalEntryHeader.cs` (+1 -1) 📝 `tests/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+32 -0) ➕ `tests/TestArchives/Archives/Zip.UnicodePathExtra.zip` (+0 -0) </details> ### 📄 Description - It may be surprising, but probably due to the history of Windows, it is not unusual to encounter zip files compressed with wrong unicode path info. - My program provides a UI for users to preview decoded paths and choose a proper encoding before extracting. However, `UnicodePathExtra` always overriding specified encoding makes this impossible for some files. - `Forced` encoding doesn't seem to be used anywhere, other than shadowing `Default`. That basically makes the two fields equivalent. Shouldn't it override `UnicodePathExtra`? Anyway, I think this is the intended behavior, instead of the current one. --- <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:19:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1170