Open JohnnyWoong opened 6 years ago
uncompress zip, file extension is jpg
Try setting the encoding on the options.
useless,the default setting is utf-8
yeah it is...set it to a different code page
what do u mean?set to encode.default?
https://github.com/adamhathcock/sharpcompress/issues/149 is similar
there still might need to be code changes to totally fix things
ok,i will try that first,thx
y i can delete zip file after i uncompress it,but cant delete 7z file after i uncompress it?
make sure everything is disposed. You'll need to show me a code sample of what you're doing if you think you've disposed everything
//zip uncompress and delete
using (var archive = ZipArchive.Open(file))
{
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
{
entry.WriteToDirectory(folder, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
File.Delete(file);
//7zip uncompress and delete
using (var archive = RarArchive.Open(file))
{
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
{
entry.WriteToDirectory(folder, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
File.Delete(file);
I'll take a look later but RarArchive
isn't 7Zip
sry,my copy wrong,RarArchive should be SevenZipArchive,the 7z file cant delete,i haven't test rar file
well, I need the exact code, not a copy/guess. As far as I can tell, disposal works correctly.
using (var archive = SevenZipArchive.Open(file))
{
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
{
entry.WriteToDirectory(folder, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
File.Delete(file);
thats is the code,cause i write 7z,zip and rar,so i copy the wrong one..
I literally tested that and it works for me. Next step for debugging would be for you to provide a github repo sample with the bug that I could validate didn't work.
I dont knw y,but same code is work 4 me today...sry abt that By the way,7z uncompress is too slow,250MB zip uncompress only need less 1 min,y 275MB 7z uncompress need about 30M..
@JohnnyWongC How do you solve this Chinese garbled problem? 😱
I literally tested that and it works for me. Next step for debugging would be for you to provide a github repo sample with the bug that I could validate didn't work.
I test it again,some file can unzip correctly,some file still garbled
test file.zip: https://www.jianguoyun.com/p/DavrLy0Q-c3-BRjQroMB the chinese file in mods directory
protected static void ZipUncompress(string file, string folder)
{
using (var archive = ZipArchive.Open(file))
{
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
{
entry.WriteToDirectory(folder, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
}
}
not fixed on version 0.32.2 yet.
when i use it, the chinese will be garbled