笔记:中文utf-8
/unicode
编码简单转换:
C:\Users\86185>C:\Env\tools\Python27\python.exe
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> "呼入电话".decode('gbk').encode('utf-8')
'\xe5\x91\xbc\xe5\x85\xa5\xe7\x94\xb5\xe8\xaf\x9d'
>>> print '\xe5\x91\xbc\xe5\x85\xa5\xe7\x94\xb5\xe8\xaf\x9d'.decode('utf-8')
呼入电话
>>> "呼入电话".decode('gbk')
u'\u547c\u5165\u7535\u8bdd'
>>>