python3 中文乱码,UnicodeEncodeError: 'latin-1' codec can't encode characters in position 10-13: ordinal not in range(256)


将其源代码复制下来运行之后,报了下面这个错误

UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-13: ordinal not in range(256)

后来苦思冥想找资料,最后发现一个办法,可以解决上述问题,就是:

在下图所示处加上下面箭头所指那句,即图后蓝色代码

account = accountraw.encode("utf-8").decode("latin1")

来源:http://blog.csdn.net/u014744494/article/details/41986647


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM