VScode写C++配置环境问题:输出端出现乱码
我Run code一个测试文件,输出会出现这个:
cd "d:\codefile\CODE\" && g++ test.cpp -o test && "d:\codefile\CODE\"test
�밴���������. . .
同时,会生成exe文件,但不会出现命令框。
我的task.json
{
"version": "2.0.0",
"command": "g++",
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"args": ["-m32","-g","-fexec-charset=GBK", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
我的launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"miDebuggerPath": "F:/mingw/ming/bin/gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"externalConsole": true,
"preLaunchTask": "g++"//
}
]
(我尝试更改编辑器右下角的编码,GB2312、GBK、UTF-8都不管用)
我的问题如上,希望可有大神指点一二 run code 输出乱码问题很难解决,现在我也没找到办法 不要用runcoder,直接F5呢
页:
[1]