我正在使用 Ant 构建 tar.gz 存档:
<tar destfile="${linux86.zip.file}" compression="gzip" longfile="gnu">
<tarfileset dir="${work.dir}/data" dirmode="755" filemode="755"
prefix="${app.folder}/data"/>
</tar>
Archive 是在 Windows 上构建的。在 Ubuntu 12 上提取名称包含非拉丁(例如西里尔)字符的文件后,名称已损坏。
有什么办法可以解决或解决这个问题吗?
最佳答案
没有。 Tar 文件仅支持 ascii 文件名。看这个问题:Creating tar archive with national characters in Java 。我认为您需要另一种格式或工具,具有更现代的设计。
请注意zip task有 encoding
属性,也许这种格式可以工作?
关于linux - 从 Ant tar 任务打包的 .tar.gz 中提取时对包含非拉丁字符的文件名进行编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12456560/