Simply use the "utf-8-sig" codec: fp = open("file.txt") s = fp.read() u = s.decode("utf-8-sig") That gives you a unicode string without the BOM.
確定! 回上一頁