VSCode中Java程序输入中文变成问号怎么办
问题描述
在VSCode中编写一个Java程序,通过Code Runner运行程序时输入中文,结果输出为????。
解决方案
打开settings.json,添加以下配置设置:
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.profiles.windows": {
"Command Prompt": {
"source": "PowerShell",
"args": ["-NoLogo", "/K chcp 65001 >nul"]
}
}
重启程序使设置生效。