被这个问题困扰了好久。各种百度各种尝试。最后在知乎找到了答案。
修改task.json,添加option那一坨:
{
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"args": ["${file}"],
"showOutput": "always",
"options": {
"env":{
"PYTHONIOENCODING": "UTF-8"
}
}
}
参考:
https://www.zhihu.com/question/41282749