V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
zungmou
V2EX  ›  Python

Python 字符编码问题,帮忙看下,这是用什么字符编码?

  •  
  •   zungmou · Mar 29, 2017 · 2688 views
    This topic created in 3325 days ago, the information mentioned may be changed or developed.
    内容如下:
    b'\xb5\xd8\xb1d\xb6\xea\xc5\xe9\xaf}\xad\xb5\xa4@'

    试过好多编码方式都解不出来,求教!
    6 replies    2017-04-04 14:58:23 +08:00
    mgna17
        1
    mgna17  
       Mar 29, 2017   ❤️ 1
    >>> chardet.detect(a)
    {'encoding': 'Big5', 'confidence': 0.99}
    >>> a.decode('Big5')
    '華康圓體破音一'
    mgna17
        2
    mgna17  
       Mar 29, 2017
    少复制了一行,这里的 a 就是楼主你贴的那段 byte
    aimoji
        3
    aimoji  
       Mar 29, 2017 via iPad
    @mgna17 怒赞!
    mingyun
        4
    mingyun  
       Mar 29, 2017
    @mgna17 学习了
    cocoakekeyu
        5
    cocoakekeyu  
       Apr 4, 2017
    get 到一个库
    zungmou
        6
    zungmou  
    OP
       Apr 4, 2017
    @mgna17 奇怪了,为什么我用 chardet 库无法识别出是 Big5 编码呢?你的版本是多少?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5363 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 09:38 · PVG 17:38 · LAX 02:38 · JFK 05:38
    ♥ Do have faith in what you're doing.