[PR #266] Force encoding #937

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

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/266

State: closed
Merged: Yes


Added property ForceEncoding to OptionsBase, purpose is to be able to force reading from or writing to an archive to use the specified encoding.

The problem I am solving with this is the ability to unpack archives that has a non-standard encoding of the filenames. This is common for zip files.

The ArchiveEncoding.Default does not solve the problem, because of two reasons.

  1. It is global and can not be set per archive, and when multiple threads are used to unpack archives this is just not possible to use.
  2. If a zip file has the UTF-8-flag set AchiveEncoding.Default is not used, and I need to be able to force the use of a specific encoding regardless of any flags.
**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/266 **State:** closed **Merged:** Yes --- Added property ForceEncoding to OptionsBase, purpose is to be able to force reading from or writing to an archive to use the specified encoding. The problem I am solving with this is the ability to unpack archives that has a non-standard encoding of the filenames. This is common for zip files. The ArchiveEncoding.Default does not solve the problem, because of two reasons. 1. It is global and can not be set per archive, and when multiple threads are used to unpack archives this is just not possible to use. 2. If a zip file has the UTF-8-flag set AchiveEncoding.Default is not used, and I need to be able to force the use of a specific encoding regardless of any flags.
claunia added the pull-request label 2026-01-29 22:18:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#937