Hi,
PasswordEncoding
option is supposed to be set to an instance of .NET's Encoding class that specifies the encoding (character set) to use to transform the password from a string
to a byte array.
So in order to specify a particular encoding, do this:
using Rebex.IO.Compression;
using System.Text;
...
// encoding to use
string encoding = "windows-1252";
var zip = new ZipArchive("password-encoding-sample.zip");
zip.Options.PasswordEncoding = Encoding.GetEncoding(encoding);
zip.Password = "öäü";
zip.ExtractAll("output", ActionOnExistingFiles.OverwriteAll);
The sample ZIP file is available here.
To determine a list of all possible character encodings, use Encoding.GetEncodings() method.
Western European languages usually use one of the following encodings:
"utf-8"
"windows-1252"
"iso-8859-1"
"windows-1250"
"iso-8859-2"
"iso-8859-15"