V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2022-08-25 14:04:31 +08:00 · 1201 次点击
    这是一个创建于 625 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2666 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 02:06 · PVG 10:06 · LAX 19:06 · JFK 22:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.