UnicodeDecodeError: 'utf8' codec can't decode bytes

▼ 編碼問題真的是個很常見且困擾的問題: 原文是ansi編碼,(windows下默認編碼),換到linux下工做,須要轉爲utf8編碼,文件多因此寫了個小程序, 其中執行到這:outfile.write(line.encode('utf-8')),會報錯: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: in
相關文章
相關標籤/搜索