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

Python3.5 用 urllib post 方法数据,不能直接 post 中文。

  •  
  •   chendajun · Jun 17, 2016 · 3452 views
    This topic created in 3798 days ago, the information mentioned may be changed or developed.
    4 replies  •  2016-06-17 20:03:51 +08:00
    gssdromen
    gssdromen
    Jun 17, 2016
    1
    urlencode 了么?
    chendajun
    chendajun
    OP
    Jun 17, 2016
    2
    @gssdromen hi ,我是 Python 小白。具体流程是这样的:我这边需 post 一个 json (里面包含中文)到系统里面,如果 encode 后服务器那边接收到的就不是中文了。
    daiqiangbudainiu
    daiqiangbudainiu
    Jun 17, 2016
    3
    @chendajun URLEncode 跟你想的应该不太一样,百度一下就知道了
    gssdromen
    gssdromen
    Jun 17, 2016
    4
    @chendajun 不论什么文字,在传输时都是需要编码成字符和数字的,在服务器那边用对应方法变回中文就行,你没有给出源码,我也不能知道到底是什么问题~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2882 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 05:29 · PVG 13:29 · LAX 21:29 · JFK 00:29
    ♥ Do have faith in what you're doing.