skip to main
|
skip to sidebar
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
Pidong WANG
Palo Alto, CA, United States
Who is a Senior NLP Engineer now
View my complete profile
Blog Archive
►
2019
(2)
►
June
(2)
►
2017
(4)
►
September
(1)
►
March
(1)
►
January
(2)
►
2016
(22)
►
October
(1)
►
September
(5)
►
August
(3)
►
July
(2)
►
June
(3)
►
May
(4)
►
April
(2)
►
March
(2)
►
2015
(4)
►
May
(1)
►
April
(2)
►
February
(1)
►
2014
(3)
►
October
(1)
►
April
(1)
►
March
(1)
►
2013
(9)
►
December
(3)
►
November
(4)
►
May
(1)
►
January
(1)
►
2012
(27)
►
December
(2)
►
November
(1)
►
September
(2)
►
July
(1)
►
June
(4)
►
May
(3)
►
April
(2)
►
March
(1)
►
February
(6)
►
January
(5)
►
2011
(19)
►
November
(1)
►
September
(4)
►
July
(2)
►
June
(3)
►
May
(4)
►
April
(2)
►
February
(1)
►
January
(2)
►
2010
(18)
►
December
(2)
►
November
(4)
►
June
(2)
►
May
(1)
►
March
(5)
►
February
(1)
►
January
(3)
▼
2009
(25)
►
December
(5)
►
August
(3)
▼
July
(8)
Linux Vim 编码 (转载)
First step of Ubuntu
In Java, how to get the OS type and OS name
Set Netbeans user Interface language
In python, how to read unicode or GBK files
In Java, how do I set a default character encoding...
Adding a DOS cmd prompt to the Windows right click...
In Java, how to change the encoding of files
►
June
(7)
►
May
(1)
►
January
(1)
►
2008
(8)
►
July
(8)
Related Sites
Google Site homepage
My NUS homepage
NUS Natural Language Processing Group
Department of Information Systems
Department of Computer Science
School of Computing-NUS
National University of Singapore
No comments:
Post a Comment