推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
abibi
V2EX  ›  Python

django 下载的 zip 压缩包文件名中包含中文,文件名字乱码

  •  
  •   abibi · Mar 14, 2016 · 3256 views
    This topic created in 3781 days ago, the information mentioned may be changed or developed.
    5 replies    2016-03-14 14:29:21 +08:00
    AntonChen
        1
    AntonChen  
       Mar 14, 2016
    试试 7zip
    ahcat
        2
    ahcat  
       Mar 14, 2016
    IE 浏览器问题。换一个浏览器。
    zhs227
        3
    zhs227  
       Mar 14, 2016
    zip 很早之前是不支持编码指示比特的, linux 服务器下打的包一般是 UTF-8 ,只能在 Linux 下打开。 Windows 下打的包一般是本地编码,只能同样使用本地编码才能打开。如果你希望在 Linux 服务器上生成的 Zip 在 Windows 下打开不乱码,你需要通过代码生成 zip 的时候把文件名编码转为 GBK 。

    由于歪国人(英语国家)比较少碰到这些问题,所以他们都没有改这个指示比特。 Django 的具体情况不了解。
    abibi
        4
    abibi  
    OP
       Mar 14, 2016
    @AntonChen @ahcat @zhs227 问题已解决谢谢了
    clino
        5
    clino  
       Mar 14, 2016
    不包含编码信息是 zip/tar 文件格式本身的问题
    https://groups.google.com/d/msg/python-cn/q7rXVGVa0Bo/xHga4vYtBgAJ
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4684 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 10:07 · PVG 18:07 · LAX 03:07 · JFK 06:07
    ♥ Do have faith in what you're doing.