python中文截断

str = '中国人'code str.decode('utf-8')[0:1].encode('utf-8')utf-8 先转换成unicode,再取子串,而后转换成utf-8unicode
相关文章
相关标签/搜索