我有unsigned int
。在python中我看到当我尝试将UNICODE字符输入普通字符串时,字符输出正常,但它们在原始字符串输出中是2个字符。如何将unsigned int
转换为2 char
?
例如
file.py
# -*- coding: utf-8 -*-
str = "Ю" # That's a unicode character
print str # It outputs normally
print str[0] # It does some output kinda '\xd0'
答案 0 :(得分:0)
好的,我想做的事情是将unicode转换为utf-8