[PR #278] [MERGED] Optional string decoder delegate: fix #277 #943

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/278
Author: @xupefei
Created: 7/15/2017
Status: Merged
Merged: 7/17/2017
Merged by: @adamhathcock

Base: issue-268Head: issue-268


📝 Commits (1)

  • 036b303 Optional string decoder delegate

📊 Changes

1 file changed (+14 additions, -3 deletions)

View changed files

📝 src/SharpCompress/Common/ArchiveEncoding.cs (+14 -3)

📄 Description

A simple usage with SimpleHelpers.FileEncoding package (which is a Chardet helper):

var f = ArchiveFactory.Open(@"X:\some-really-old.zip", new ReaderOptions
{
    ArchiveEncoding = new ArchiveEncoding
    {
        CustomDecoder = (bytes, start, count) =>
            FileEncoding.DetectFileEncoding(bytes, start, count, Encoding.UTF8)
                .GetString(bytes, start, count)
    }
});
foreach (var entry in f.Entries)
{
    Debug.WriteLine(entry.Key);
}

🔄 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/278 **Author:** [@xupefei](https://github.com/xupefei) **Created:** 7/15/2017 **Status:** ✅ Merged **Merged:** 7/17/2017 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `issue-268` ← **Head:** `issue-268` --- ### 📝 Commits (1) - [`036b303`](https://github.com/adamhathcock/sharpcompress/commit/036b303944382ed2c4a8e4282e2552a5e5ed704e) Optional string decoder delegate ### 📊 Changes **1 file changed** (+14 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/ArchiveEncoding.cs` (+14 -3) </details> ### 📄 Description A simple usage with [SimpleHelpers.FileEncoding](https://www.nuget.org/packages/SimpleHelpers.FileEncoding/) package (which is a Chardet helper): ``` var f = ArchiveFactory.Open(@"X:\some-really-old.zip", new ReaderOptions { ArchiveEncoding = new ArchiveEncoding { CustomDecoder = (bytes, start, count) => FileEncoding.DetectFileEncoding(bytes, start, count, Encoding.UTF8) .GetString(bytes, start, count) } }); foreach (var entry in f.Entries) { Debug.WriteLine(entry.Key); } ``` --- <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:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#943