python str unicode
str.decode('utf-8') -> unicode
從 ascii 轉成 unicode
encode 反來把 unicode 轉成 ascii
想要f.write utf-8 file 可以使用
import codecs
file = codecs.open("lol", "w", "utf-8")
file.write(u'\ufeff')
file.close()
- Sep 04 Wed 2013 18:22
-
[python] 中文 encode decode utf-8


請先 登入 以發表留言。