mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
ZipReader, Entry.Key encoding is not UTF8 #117
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 @WilhelmJP on GitHub (Aug 15, 2016).
File names with german umlauts are not unzipped correctly. Therfore searching for a certain key will not work. Here is my code snipped:
Best
Wilhelm
@adamhathcock commented on GitHub (Aug 20, 2016):
Does it help if you change the ArchiveEncoding class?
@k003bzw commented on GitHub (Aug 25, 2016):
it also does not work. You can use my project file to test the ArchiveEncoding class.
Project.zip
@adamhathcock commented on GitHub (Sep 27, 2016):
The extract seems to work for me.
I did this:
@adamhathcock commented on GitHub (Sep 27, 2016):
Created an Archive like this and the character was fine:
@Wagalv commented on GitHub (Nov 24, 2016):
I had the same issue, but for Portuguese and Spanish characters. To solve this I used the follow code:
using (Stream stream = File.OpenRead(path))
{
SharpCompress.Common.ArchiveEncoding.Default = System.Text.Encoding.GetEncoding(850);
var reader = ReaderFactory.Open(stream, Options.None);
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
reader.WriteEntryToDirectory(savePath, ExtractOptions.ExtractFullPath | ExtractOptions.Overwrite);
}
}