标签: python encoding utf-8 console
我正在尝试将utf-8字符打印到控制台。
这不行吗?
答案 0 :(得分:1)
前一条语句将值打印为bytes,而后一条语句使用string值。将其更改为bytes将为您提供所需的输出。
bytes
string
>>> b'\xc3\x91'.decode() >>> 'Ñ'