彻底搞清楚unicode和utf8编码

python2中:

  • linux: 默认是utf-8
  • windows: 默认gb2312

在python3中,所有的字符都被转化成了unicode

>>> s = "我用python"
>>> s.encode("utf-8")
b'\xe6\x88\x91\xe7\x94\xa8python'
>>>

results matching ""

    No results matching ""