How to create ZIP files with a specific encoding

On my Linux server, I have accented files (test-éàïù.zip). When I add them to a new ZIP file using the 7zip command line tool, the encoding / encoding information is not saved and the file names are not displayed correctly when opened on a Windows machine. I know that 7zip creates Zip V1.0 archives, not 2.0. Maybe the encoding is limited to MSDos encoding? How can I specify the encoding using 7zip or some other zip tool to get portable archives?

Thank:)

+2


source to share


1 answer


This is a superuser question, BUT ...

ZIP uses the standard IBM437 code page. It is possible to use UTF-8, but not all zip tools and libraries support this. Some zip tools will execute arbitrary code pages, although the zip spec only allows IBM437 or UTF-8 to be used. I think WinRar is one such tool.

DotNetZip does encoding. It will do UTF-8 or arbitrary code page. if you are writing an application there is a .NET library. If you are working with a script, there are command line tools. Anyway, DotNetZip requires .NET. You need Mono to run Linux.

example command line:



zipit.exe Olivier.zip -cp 860 test-éàïù.txt 

      

(to use code page 860) I'm not sure if Windows Explorer correctly handles zip files with alternate encoding for filenames in zip files.

See How to pin specified folders using the command line for more information on this zipit.exe tool.

+9


source







All Articles