기본적으로 c/c++은 vs 쓰고 있기는 한데 vscode에도 작업환경 정도는 만들어 두고 싶어서 이것저것 만지는 중인데 인코딩 문제 인가 입력하는 한글이 깨져 보이네;;;

1. 이게 settings.json이고

{
"workbench.colorTheme": "One Dark Pro Darker",
"workbench.editor.enablePreview": false,
"git.enableSmartCommit": true,
"git.autofetch": true,
"git.confirmSync": false,
"cmake.showOptionsMovedNotification": false,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"workbench.settings.applyToAllProfiles": [
"terminal.integrated.defaultProfile.windows",
"files.encoding"
],
"git.defaultCloneDirectory": "",
"explorer.confirmDelete": false,
"editor.dropIntoEditor.preferences": [],
"terminal.integrated.profiles.windows": {
"PowerShell": {
"path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"args": ["-NoLogo"]
}
},
"terminal.integrated.env.windows": {
"LANG": "ko_KR.UTF-8"
},
"files.autoGuessEncoding": false,
"files.encoding": "utf8",
"terminal.integrated.automationProfile.windows": {},
"git.openRepositoryInParentFolders": "never",
"explorer.confirmDragAndDrop": false,
"chat.editing.alwaysSaveWithGeneratedChanges": true
}


2. 이게 tasks.json

{
"version": "2.0.0",
"tasks": [
{
"label": "build C++",
"type": "shell",
"command": "powershell",
"args": [
"-Command",
"chcp 65001; gcc -g -fexec-charset=UTF-8 -finput-charset=UTF-8 ${file} -o ${fileDirname}/${fileBasenameNoExtension}.exe -lstdc++"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
],
"detail": "Generated task for building C++ project"
},
{
"label": "build C",
"type": "shell",
"command": "powershell",
"args": [
"-Command",
"chcp 65001; gcc -g -fexec-charset=UTF-8 -finput-charset=UTF-8 ${file} -o ${fileDirname}/${fileBasenameNoExtension}.exe"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
],
"detail": "Generated task for building C project"
},
{
"label": "run C++",
"type": "shell",
"command": "powershell",
"args": [
"-Command",
"chcp 65001; ${fileDirname}/${fileBasenameNoExtension}.exe"
],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "run C",
"type": "shell",
"command": "powershell",
"args": [
"-Command",
"chcp 65001; ${fileDirname}/${fileBasenameNoExtension}.exe"
],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
}
]
}


3. 이거는 launch.json

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": "GDB - C++",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [
                {
                    "name": "LANG",
                    "value": "ko_KR.UTF-8"
                }
            ],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/msys64/usr/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build C++"
        },
        {
            "name": "GDB - C",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [
                {
                    "name": "LANG",
                    "value": "ko_KR.UTF-8"
                }
            ],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/msys64/usr/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build C"
        }
    ]
}


4. 이거는 c_cpp_properties

{

    "configurations": [
        {
            "name": "C++_workplace",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/msys64/ucrt64/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "intelliSenseMode": "windows-gcc-x64"
        },
        {
            "name": "C_workplace",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/msys64/ucrt64/bin/gcc.exe",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4

}


한글 출력까지는 잘 되는데 입력받은 한글은 출력할 때 깨져보임;;


powershell이나 cmd 자체 인코딩 문제인거 같아서 gpt 도움 받아서 위에 chcp 65001 삽입해서 한글 출력까지는 되도록 했는데

Active code page: 65001 출력 창에 뜨는데도 입력받은 한글은 깨져서 보임


혹시 해결 방법 아시는분?