Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux bash-zip-unicode选项_Linux_Bash_Unicode_Utf 8 - Fatal编程技术网

Linux bash-zip-unicode选项

Linux bash-zip-unicode选项,linux,bash,unicode,utf-8,Linux,Bash,Unicode,Utf 8,使用bash-zip存档时,我希望多字节字符以UTF-8编码。我希望确保跨平台正确提取包含多字节字符的路径。比如说,我在OSX上压缩了文件,并希望它在Windows上正确解压缩 zip man的指导如下 zip archive dir -r -UN=UTF8 “强制zip将UTF-8作为本机存储在存档中。”() 问题 OS X bash shell: $ zip -r test.zip tardir -UN=UTF8 zip error: Invalid command arguments (

使用bash-zip存档时,我希望多字节字符以UTF-8编码。我希望确保跨平台正确提取包含多字节字符的路径。比如说,我在OSX上压缩了文件,并希望它在Windows上正确解压缩

zip man的指导如下

zip archive dir -r -UN=UTF8
“强制zip将UTF-8作为本机存储在存档中。”()

问题

OS X bash shell:

$ zip -r test.zip tardir -UN=UTF8
zip error: Invalid command arguments (short option 'N' not supported)
使用长格式无助于:

$ zip -r test.zip tardir --unicode=UTF8
zip error: Invalid command arguments (long option 'unicode' not supported)

抱歉,Windows的解压/解压版本不支持UTF-8。必须对字符进行编码以匹配用户的8位代码页。最好使用
-UN=e
来转义非ASCII码chars@AlastairMcCormack谢谢您的宝贵意见。好的,Windows的解压/解压版本不支持UTF-8。必须对字符进行编码以匹配用户的8位代码页。最好使用
-UN=e
来转义非ASCII码chars@AlastairMcCormack谢谢你的评论。