I'm using a WCF to unzip a file that I receive from an API (that I cant modifie).
The Zip file that I receive contains XML files that are not encoded.
The problem is that I cant Deserialise these files later (I can't even load them to a XmlDocument).
I want to do one of these two:
1. Add the encoding when extracting the zip file,
2. Or add the encoding to the file before reading it later (just before deserializing it)
This is a pick from the code when extracting the zip file:
var subStream = entry.OpenReader();
Directory.CreateDirectory(subPath);
subPath +="\\" + entryPath.Last();
using (var output = new FileStream(subPath, FileMode.OpenOrCreate))
{
await entryStream.CopyToAsync(output);
}
PS: Adding the encoding o the entry doesn't modifie the encoding when the file is saved.
Thank you.