Preface
Recently, when vs code
I execute python
a script in it, only Chinese characters are printed, and the characters are garbled.
content
First check whether the encoding set setting in the lower right corner is correct.
Check whether the encoding set setting in the lower right corner is correct:
If not, utf-8
click Modify.
If it still doesn’t work, do the following:
Modify user settings
Path: File
—> preferences
—>settings
Search: code-runner.executorMap
, then clickedit in settings.json
Add to:
"code-runner.executorMap": {
"python": "set PYTHONIOENCODING=utf8 && python -u",
}
That's the end.
Reference address:
https://blog.csdn.net/zhangfeng0881/article/details/112632018