python中文截斷

str = '中國人'code str.decode('utf-8')[0:1].encode('utf-8')utf-8 先轉換成unicode,再取子串,而後轉換成utf-8unicode
相關文章
相關標籤/搜索