返回顶部

收藏

Convert a Unicode string into an 8-bit string

更多
#Convert a Unicode string into an 8-bit string using a specific encoding, 
#Unicode objects provide an encode() method that takes one argument, 
#the name of the encoding. Lowercase names for encodings are preferred.

print u'\xc3\xa4'.encode('utf-8')

标签:Python,基础

收藏

0人收藏

支持

0

反对

0

发表评论