Wang Pidong's Homepage
Tuesday, July 7, 2009
In python, how to read unicode or GBK files
import codecs
infile=codecs.open(infilename,"r","gbk")
line=infile.readline()
# all the lines which are read from infile are encoded in GBK
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment