msbuildtasks
msbuildtasks copied to clipboard
Zip files with accented name
I want to zip files which names contains accentented characters. The file name within the zip file will be changed.
Examples
Build project:
<?xml version="1.0" encoding="utf-8" ?>
<Project DefaultTargets="CompressFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="CompressFiles" >
<ItemGroup>
<FilesToCompress Include="Files\**\*.*" />
</ItemGroup>
<Zip Files="@(FilesToCompress)" WorkingDirectory="Files" ZipFileName="Result.zip" />
</Target>
</Project>
Files attached: AccentError.zip
Example 1
- File names:
- "01 NonAccentented.txt"
- "02 Árvíztűrő tükörfúrógép.txt"
- File names in the result zip:
- "01 NonAccentented.txt"
- "0"
- The first character of the original file name (if it is non accented).
Example 2
- File names:
- "01 NonAccentented.txt"
- "Árvíztűrő tükörfúrógép.txt"
- Note that the file name starts with an accented character.
- File names in the result zip:
- "01 NonAccentented.txt"
- "�1 NonAccentented.txt"
Try to use https://docs.microsoft.com/en-us/visualstudio/msbuild/zipdirectory-task from standard MSBuild tasks