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

** Python 字符编码**的一点学习心得~ (๑•ᴗ•๑) 搞懂原理, 一劳永逸.

  •  
  •   daya0576 · 2017-08-01 01:09:20 +08:00 · 2261 次点击
    这是一个创建于 2453 天前的主题,其中的信息可能已经有所发展或是发生改变。

    近日被 python 的编码问题卡了好几次 ><
    终于静下心来看看资料, 终于懂了一丢丢.
    并总结了下面这个图, 大家看看有没有问题 XD https://changchen.me/images/blog/170801_encoding/h.png


    ### 对这个图的解释, 我直接放我博客的链接好了:
    https://changchen.me/blog/20170731/python-encoding-decoding/
    1. python3 str 类型
    2. python3 bytes 类型
    3. encoding/decoding
    4. utf-8 原理

    欢迎留言提问或纠正错误哦

    2 条回复    2017-08-03 12:12:53 +08:00
    ivechan
        1
    ivechan  
       2017-08-02 18:10:05 +08:00
    在 Py3 里, 编码其实已经不是问题了, 当然前提是你忘记 Py2 的编码处理.
    daya0576
        2
    daya0576  
    OP
       2017-08-03 12:12:53 +08:00
    @ivechan 对的.
    所以好像没人感兴趣 哈哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5198 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:27 · PVG 15:27 · LAX 00:27 · JFK 03:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.