mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
usability - compressed filename - encoding #292
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @thanasisCoung on GitHub (May 2, 2018).
I used the sharpcompress 0.20.0 today against a thousand zips with 1 GB each searching for specific files for extracting info on the fly. It works. Excellent. 👍
I want to thank you and make two observations
-observation 1
If i want to use the compressed filename i have to extract it from reader.Entry.Key. Maybe something like reader.Entry.Key.Name & reader.Entry.Key.FullName
-example
-observation 2
can't find a way to open a stream with an enconding so i have to re-open
using (StreamReader rep737 = new StreamReader(rep, Encoding.GetEncoding("ibm737")))--my fault you got it
ReaderOptions readerOptions = new ReaderOptions() { ArchiveEncoding=new ArchiveEncoding() {Forced= Encoding.GetEncoding("ibm737") } };@adamhathcock commented on GitHub (May 5, 2018):
Thanks for the feedback!
I went for the name "Key" because the key isn't necessarily supposed to mean a filepath in an archive. I understand this is usually the case though. You can contribute some extension methods for better handling file names if you'd like.
I'm about to release some fixes to zip encoding as someone pointed out the proper encoding: https://github.com/adamhathcock/sharpcompress/pull/363/files