报错UnicodeDecodeError: 'gbk' codec can't decode bytes in position
ipath = 'D:/学习/语料库/SogouC.mini/Sample/C000013/18.txt'
uipath = unicode(ipath , "utf8")
# uipath = ipath.decode('utf8')
f = codecs.open(uipath,'r','gbk','ignore')
text = f.read()
f.close()
参数ignore会忽略非法字符