惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
J
Java Code Geeks
The Register - Security
The Register - Security
V
Visual Studio Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
N
Netflix TechBlog - Medium
博客园 - 聂微东
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
美团技术团队
爱范儿
爱范儿
A
About on SuperTechFans
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
PCI Perspectives
PCI Perspectives
MyScale Blog
MyScale Blog
T
Threatpost
S
Securelist
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
Vercel News
Vercel News
宝玉的分享
宝玉的分享
Project Zero
Project Zero
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客
M
MIT News - Artificial intelligence
雷峰网
雷峰网
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Google Online Security Blog
Google Online Security Blog
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
T
Troy Hunt's Blog
U
Unit 42
Scott Helme
Scott Helme

博客园 - 明月我心

百度网盘的同步空间使用方式 windows10删除多出的oem分区 自己搭建anki同步服务器 linux设置自动更换壁纸 Node判断文件是否链接 解决Qualcomm Atheros AR8161 Gigabit Ethernet网卡Linux下坏掉的问题 Openbox中指定目录打开程序 Openbox简单支持平铺 linux关闭双显卡的方法 rdesktop共享剪贴板的问题 Apache FTPServer安装为Windows服务的问题 Dell Inspiron One2330连接WPA2-PSK的问题 12306快速输入验证码办法 rsync命令中的include参数顺序问题 gnome下使用x-tile平铺窗口 开始相信360是款好软件,见下图 adb shell后insufficient permissions for device的问题 Gentoo linux下Adobe AIR运行环境的安装 php升级到5.3后Discuz论坛不能使用的问题
linux下zip文件解压乱码的问题
明月我心 · 2017-07-04 · via 博客园 - 明月我心

因为编码问题,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/

安装这个包应该就可以完美的解决问题吧,因为我已经使用上面的方法解决了问题,就不试这个了