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
holinhot
V2EX  ›  Python

\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053 这个是什么编码

  •  
  •   holinhot · 2015-04-27 14:59:45 +08:00 · 6985 次点击
    这是一个创建于 3292 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我爬的百度title怎么得到的这个

    16 条回复    2015-04-28 00:49:57 +08:00
    bestsanmao
        1
    bestsanmao  
       2015-04-27 15:01:02 +08:00
    unicode
    ynyounuo
        2
    ynyounuo  
       2015-04-27 15:01:23 +08:00   ❤️ 2
    百度一下,你就知道
    Unicode Hex
    holinhot
        3
    holinhot  
    OP
       2015-04-27 15:02:16 +08:00
    我把他转换回来了

    @bestsanmao
    @ynyounuo
    chevalier
        4
    chevalier  
       2015-04-27 15:03:13 +08:00
    In [9]: print u'\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053'
    百度一下,你就知道

    In [10]:
    zkd8907
        5
    zkd8907  
       2015-04-27 15:25:50 +08:00
    clino
        6
    clino  
       2015-04-27 15:26:29 +08:00
    >>> print '\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053'.decode("unicode_escape")
    百度一下,你就知道
    Him
        7
    Him  
       2015-04-27 16:01:31 +08:00   ❤️ 1
    谜底就在谜面上
    zhangsan
        8
    zhangsan  
       2015-04-27 16:14:58 +08:00
    \用来转义
    u表示后面的字符表示的是unicode
    DavidHu
        9
    DavidHu  
       2015-04-27 16:17:59 +08:00
    百度一下,你就知道 2333333
    cruisehu
        10
    cruisehu  
       2015-04-27 16:28:37 +08:00
    randyzhao
        11
    randyzhao  
       2015-04-27 16:31:22 +08:00
    百度一下,你就知道
    答案就是解决办法 233
    nellace
        12
    nellace  
       2015-04-27 17:50:18 +08:00
    还真的是百度一下,你就知道
    holinhot
        13
    holinhot  
    OP
       2015-04-27 17:57:44 +08:00
    @nellace 必须是啊
    khan
        14
    khan  
       2015-04-27 18:12:20 +08:00
    unicode 的 utf16?
    233
        15
    233  
       2015-04-28 00:36:53 +08:00
    哈哈哈, 试了一下才看懂评论. 果然是百度一下,你就知道
    kzzhr
        16
    kzzhr  
       2015-04-28 00:49:57 +08:00 via Android
    广告贴
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1762 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 00:37 · PVG 08:37 · LAX 17:37 · JFK 20:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.