在终端直接打印,是显示 unicode 形式的编码,但是实质没变 !
当字符串是 str类型 的 unicode形式 编码
s = "\u300a\u5200\u5251\u4e71\u821e\u300b" # 类型:str
s.decode(' unicode_escape ') # 类型:unicode 输出:《刀剑乱舞》
在终端直接打印,是显示 unicode 形式的编码,但是实质没变 !
当字符串是 str类型 的 unicode形式 编码
s = "\u300a\u5200\u5251\u4e71\u821e\u300b" # 类型:str
s.decode(' unicode_escape ') # 类型:unicode 输出:《刀剑乱舞》