Add non-ASCII file names to zip in Java

后端 未结 7 1345
时光说笑
时光说笑 2020-12-14 08:38

What is the best way to add non-ASCII file names to a zip file using Java, in such a way that the files can be properly re

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 09:15

    From a quick look at the TrueZIP manual - they recommend the JAR format:

    It uses UTF-8 for file name encoding and comments - unlike ZIP, which only uses IBM437.

    This probably means that the API is using the java.util.zip package for its implementation; that documentation states that it is still using a ZIP format from 1996. Unicode support wasn't added to the PKWARE .ZIP File Format Specification until 2006.

提交回复
热议问题