linux下zip檔案解壓亂碼的問題,linuxzip解壓亂碼

來源:互聯網
上載者:User

linux下zip檔案解壓亂碼的問題,linuxzip解壓亂碼

因為編碼問題,zip檔案中的中文檔案在linux下解壓會出現亂碼

如果你使用archlinux那麼使用AUR安裝unzip-natspec就可以解決這個問題

https://aur.archlinux.org/packages/unzip-natspec/

 

這個時候,使用unzip xxx.zip就可以正確解壓檔案

 

然後在file-roller歸檔管理器中操作,中文名稱依然是亂碼,據說是因為file-roller優先使用p7zip

 

刪除p7zip後問題解決

 

然而我還想同時能夠使用p7zip軟體包,誰知道這個問題如何解決?

 

從這裡https://git.gnome.org//browse/file-roller/下載代碼研究,發現這樣的邏輯

    /* give priority to 7z, unzip and zip that supports ZIP files better. */    if ((strcmp (mime_type, "application/zip") == 0)        || (strcmp (mime_type, "application/x-cbz") == 0))    {        if (_g_program_is_available ("7z", check_command)) {            return capabilities;        }        if (!_g_program_is_available ("unzip", check_command)) {            capabilities |= FR_ARCHIVE_CAN_READ;        }        if (!_g_program_is_available ("zip", check_command)) {            capabilities |= FR_ARCHIVE_CAN_WRITE;        }        return capabilities;    }

這裡是寫死的,看起來除了給代碼打補丁是沒什麼好辦法了

 

最後的解決辦法,發現AUR中同樣存在類似的軟體包p7zip-natspec

https://aur.archlinux.org/packages/p7zip-natspec/

安裝這個包應該就可以完美的解決問題吧,因為我已經使用上面的方法解決了問題,就不試這個了

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.