Cursor 터미널과 Git에서 한글이 깨지는 건 대부분 Windows 코드페이지(CP949) 때문이다. PowerShell 프로필에 UTF-8 자동 전환 스크립트를 넣으면 터미널·Git 커밋까지 대부분 같이 해결된다.
절차
1단계: PowerShell 프로필 만들기
경로 (Windows PowerShell 5.1):
C:\Users\<사용자명>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
PowerShell 7+(pwsh)라면:
C:\Users\<사용자명>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
파일이 없으면 새로 만들고, 아래 내용을 넣는다.
if ($Host.Name -eq 'ConsoleHost') {
try {
chcp 65001 | Out-Null
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
} catch {}
}
확인 방법: $PROFILE로 경로 확인, Test-Path $PROFILE이 True면 정상 생성.
2단계: Cursor 재시작 후 확인
- 모든 터미널 종료 (Ctrl+Shift+P → Terminal: Kill All Terminals)
- Cursor 재시작 → 새 터미널 열기
- 아래로 확인
chcp
Write-Output "한글 테스트"
확인 방법: Active code page: 65001이 나오고 "한글 테스트"가 깨지지 않으면 끝.
정리
- 한글 깨짐의 대부분 원인은 Git이 아니라 Windows 코드페이지(CP949)다.
- PowerShell 프로필에 UTF-8 전환 스크립트를 넣으면 터미널·Git 커밋까지 대부분 같이 해결된다.
- 그래도 커밋 메시지가 깨지면, git commit -F + UTF-8 파일로 우회할 수 있다.
728x90
반응형
'Record > Trubble Shooting' 카테고리의 다른 글
| 싱글톤 Bean 공유 상태로 동시 Ajax 응답이 섞인 사례 (0) | 2026.06.16 |
|---|---|
| 외부망에서만 API가 Empty Response로 끊긴 사례 해결 (0) | 2026.06.16 |
| [Trouble Shooting] 지도 포함 리포트 이미지 삽입 문제 해결 (0) | 2026.02.18 |
| IIS API 요청 실패 및 DB 연결 문제 해결 (0) | 2025.01.26 |
| [Python] pip 명령어 문제 해결: Fatal error in launcher: Unable to create process using '"' (2) | 2023.10.07 |