在Python 2.x,程式中所有字串,其實都是原始位元組集合。 ... text = u'測試' b_str = text.encode('big5') with open('text.txt', 'w') as f: f.write(b_str).
確定! 回上一頁