I have a task to extract files from zip archive. Unfortunately, as I found from another question here, windows explorer in win10 still uses cp866 to encode filenames inside of archive file. .NET Core doesn't support this codepage, so extracting the archive results in non-readable symbols. Aspose.Zip faced me with the exactly same problem. Is there a way to solve this in .net core 3.1 stack? Maybe in .net 5?
By default, both .NET Core 3.1 and .NET 5+ includes limited set of encodings out-of-the-box. But, you can fix this by only pair rows of code: you just need to register a custom encoding provider (see https://learn.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider?view=net-5.0) and voila - get needed encoding by its number:
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var encoding = Encoding.GetEncoding(866);
Then you can easily extract files from a zip, archived in Win Explorer, without non-ascii symbols problem.