推荐学习书目
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
tankren
V2EX  ›  Python

zip 文件编码问题

  •  
  •   tankren · Aug 25, 2022 · 1632 views
    This topic created in 1358 days ago, the information mentioned may be changed or developed.

    用 requests.get 和 read+write 组合下载的 zip 文件在中文系统下一切正常,但是在英文系统下文件名都是乱码。

    r = requests.get(url)
    with open(output, 'wb') as f:
        f.write(r.content)
    

    网上找了很多资料发现好像没办法转换,是否只能解压缩,改名字然后重新 UTF-8 压缩才行了? 小白自学的,还请解惑,谢谢

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5464 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 08:49 · PVG 16:49 · LAX 01:49 · JFK 04:49
    ♥ Do have faith in what you're doing.