将一个UNICODE字符转换为两个ASCII字符

时间:2014-04-03 07:16:10

标签: python c++ unicode ascii

我有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'

1 个答案:

答案 0 :(得分:0)

好的,我想做的事情是将unicode转换为utf-8