I have a zip file with a csv file inside it. I am using following code to read the file:
using (ZipArchive zipArchive = ZipFile.OpenRead(filePath))
{
var zipArchiveEntry = zipArchive.GetEntry("File.csv");
var zipEntry = zipArchiveEntry.Open();
...
}
The zipEntry is of type System.IO.Compreesion.Deflatestream.
I tried using StreamReader.CurrentEncoding, but its giving wrong encoding value.
I am using this solution now,
this.GetFileEncoding(zipEntry)
but getting NotSupportedException at fileStrem.Length.
How do i find the right Encoding of the zipEntry (File.csv)?