我用的360壓縮,然后出現亂碼。
解決方法:可以下載最新的winrar,5以上的版本。
原因從別的地方查到的:備份一下。
詳情可以參看這里:感謝作者。
http://frank19900731.github.io/blog/2015/02/11/jie-jue-mac-xia-zip-ya-suo-wen-jian-zai-windows-xia-xian-shi-luan-ma-de-wen-ti/
知乎上關於這個問題的 解答 是
Mac OS X 系統自帶的壓縮程序對 zip 文件名用 UTF-8 編碼,但 zip 文件頭中沒有聲明 PKZIP 高版本增加的 Unicode 位。Windows 會認為文件名是 ANSI 編碼,結果顯示亂碼。
經過簡單的資料閱讀和測試,我大概驗證了下這種解釋。
用 locale
命令查看我的 MBP 系統編碼,確實是 UTF-8。
關於 ANSI 編碼 ,在中文 Windows 系統中可能是 GBK 編碼,而在其他語言的 Windows 系統又可能是別的。可以想見,Mac 下打出的壓縮包在不同語言的 Windows 下會亂得各具特色。
當然,並不是所有解壓縮軟件都會一股腦地用 ANSI 編碼進行解壓。有的解壓軟件能夠自動識別(文件名)編碼並不確定的時候請使用者選擇,比如 Mac 下的 The Unarchiver。根據我在中文 Win7 下的測試,不同的解壓縮軟件對壓縮文件的默認“理解”也是不同的,快壓會解出亂碼,而 7zip、Winrar 則可以正確解碼。
一種直觀的想法是,可以對文件名給出統一編碼格式或者將編碼寫進壓縮文件供解壓縮程序讀取。然而,Zip files and Encoding – I hate you. 中提到
The Zip spec does not seem to know that there are normalization models for UTF-8, when there are actually 4 (or more, because there is some non-standard ones too!). The Zip file gives no guidance as to how file names inside zip files are to be normalized.
…
The Zip spec says that the only supported encodings are CP437 and UTF-8, but everyone has ignored that. Implementers just encode file names however they want (usually byte for byte as they are in the OS…
很遺憾,Mac 自帶的 zip 命令就屬於最后一句中 Implementers。雖然我不是很清楚“文件頭中沒有聲明 PKZIP 高版本增加的 Unicode 位”中的細節,不過后來通過比較發現,無亂碼和有亂碼的 zip 文件,以 16進制方式查看時,文件名中中文字符的編碼是一樣的,不同之處確實在 zip 文件頭。