mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Encoding with ArchiveFactory.WriteToDirectory #458
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 @TheRisenPhoenix on GitHub (May 4, 2021).
I've ran into an issue where I want to extract a zip archive. Inside the archive, there is a file with german Umlaute: "Übung.txt"
I use
ArchiveFactory.WriteToDirectoryto extract the archive, but the extracted file shows some questionmark instead of "Ü". (so, apparently, the encoding is wrong). I am using Windows 10.The method provides an option-argument, however it does not contain anything encoding-related.
I searched the documentation and came across an example usage of reading the file and extracting it. There, you can provide some reader options:
I tried various different encodings, but none worked.
Am I doing something incorrectly? Or might this be a bug?
Also, I'm wondering what the reason is that
ReaderFactory.Openhas an option-argument that provides encoding information, butArchiveFactory.WriteToDirectorydoesn't?@adamhathcock commented on GitHub (Jun 4, 2021):
There could be several things going wrong here. Encoding within the archive and/or encoding at the code level once it makes a string. I'm not the best with encodings so I'm not sure. I'd need a sample file to see more.
WriteToDirectory is an extension method that's just a helper. It's not meant to cover all scenarios.
@TheRisenPhoenix commented on GitHub (Jun 4, 2021):
Thanks for your reply!
I prepared a sample file, I hope that it helps you to track down the issue.
Is there anything more I can do to spot the problem?