print函数无法输出特殊字符,显示编码错误问题
作者:互联网
解决:https://blog.csdn.net/jim7424994/article/details/22675759
错误'gbk' codec can't encode character '\u0e40' in position 0: illegal multibyte sequence
print无法打印出utf-8中的所有特殊字符
把默认编码改成gb18030(只改成utf-8的话中文显示乱码)
import io
import sys
import urllib.request
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
标签:编码,gb18030,stdout,sys,io,print,import,特殊字符 来源: https://www.cnblogs.com/baitian963/p/12997126.html