我正在尝试以.fits格式编写一个文件,我最好能说这个文件需要utf编码,最好是utf-8。如何在utf-8中为文件写一个整数?
答案 0 :(得分:1)
How to encode a string in utf8 for std out:
myString = "string"
string.encode('utf8')
A python post by Jon Skeet on how to write to a file with utf8:
import codecs
file = codecs.open("lol", "w", "utf-8")
file.write(u'\ufeff')
file.close()