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

IE 内核浏览器地址栏直接输入中文乱码的问题

  •  
  •   dddd · Mar 13, 2015 · 4425 views
    This topic created in 4215 days ago, the information mentioned may be changed or developed.
    我后端使用tornado

    html5 页面指定了编码 utf-8

    比如我直接在IE内核的浏览器(Win 7,火狐,Chrome 都不会)地址栏输入 http://localhost:8989/test?name=张三

    self.get_argument('name', None) 得到的值就会乱码

    诸位有出现这样的情况吗?怎么解决?
    7 replies  •  2015-03-13 20:05:24 +08:00
    b821025551b
        1
    b821025551b  
       Mar 13, 2015
    base64编码解码
    lianyue
        2
    lianyue  
       Mar 13, 2015
    url 编码下 ?namee=urlencode(张三)
    w88975
        3
    w88975  
       Mar 13, 2015
    你首先用js来获取argument 看看是不是乱码 如果js取到的不是乱码,那么就是你框架的问题了
    unknownservice
        4
    unknownservice  
       Mar 13, 2015
    先encode 再decode
    dddd
        5
    dddd  
    OP
       Mar 13, 2015
    本来链接是嵌入页面的,我写了个ui_method , 返回 urllib.quote(s.encode('utf-8'))

    好了解决了
    abscon
        6
    abscon  
       Mar 13, 2015 via Android
    乱码?是百分号编码吧
    dddd
        7
    dddd  
    OP
       Mar 13, 2015
    @abscon 呵呵,这个我还是区分得了的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   981 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:34 · PVG 02:34 · LAX 11:34 · JFK 14:34
    ♥ Do have faith in what you're doing.