Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

14.2. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 679: invalid start byte

解決方法指定編碼encoding='utf-8', errors='ignore'

with open(cfgfile+'.in','r', encoding='utf-8', errors='ignore') as f:
     for line in f.readlines():
     	pring(line)