赞
踩
- import codecs
- lines = codecs.open(filename1,'r',encoding='utf-8')
- for line in lines:
- print(line.encode('utf-8'))
- with open(filename2, 'w') as lines:
- for line in list_s:
- lines.write(line.encode('utf-8')+'\n')
这样就完美解决了这个UnicodeDecode问题。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。