Unicode files and Python
Reading and writing Unicode files from Python is simple. Usecodecs.open() and specify the encoding.
import codecs
# Open a UTF-8 file in read mode
infile = codecs.open("infile.txt", "r", "utf-8")
# Read its contents as one large Unicode string.
text = infile.read()
# Close the file.
infile.close()
http://www.jorendorff.com/articles/unicode/python.html
Hiç yorum yok:
Yorum Gönder