2011-04-25

Python: read utf-8 file

This how I read utf-8 (without BOM) file in python:
import codecs
txtfile = codecs.open("bla.txt", "r", "utf-8")
t= txtfile.read()
txtfile.close()
print t

Комментариев нет:

Отправить комментарий