[API Proposal]: Provide a NormalizeEntrySeparator(Char, Char) method for ZipFileExtension. #113058
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.IO.Compression
Milestone
Background and motivation
For zip files, ZipFile allows the creation of archives with
'\'
as the filename separator. However, in practice, entry paths are usually provided using a method similar to the following:On Windows platforms, this results in paths separated by
'\'
. When the resulting .zip archive is moved to a Unix platform and extracted using ZipFile, issues arise, as mentioned in issue #98247 .I believe it would be beneficial to provide an API to normalize the path separators in the entries of the archive to ensure compatibility across different operating systems.
API Proposal
API Usage
Alternative Designs
Perhaps we could also provide an Option when calling ZipFile.Open that allows users to specify their own separator, or offer an overload for functions like CreateEntry or CreateEntryFromFile that includes a separatorChar parameter. However, this might make things more complicated.
Risks
No response
The text was updated successfully, but these errors were encountered: