# Fix Windows AI Agent Encoding

Windows POSIX shells can garble Chinese output from Python, PowerShell, and cmd.exe. This skill gives targeted UTF-8 and GBK fixes for Claude, Codex, and related agents.

## Install

```bash
npx skillstore add gkd2323c/charset-fix
```

## Metadata

- Status: approved
- Slug: gkd2323c-charset-fix
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: 1a44d5bbc8d6644149bb4f2aeb9bb17e8b3a6d9fd1f8ee23e970d9bbfd9b0762
- Author: gkd2323c
- GitHub username: gkd2323c
- License: MIT
- Repository: https://github.com/gkd2323c/charset-fix/tree/master/
- Ref: 30c73eac2afe762f6aa9c4553158769369d47351
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 81
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/gkd2323c-charset-fix
- Manifest: https://skillstore.pages.dev/api/skills/gkd2323c-charset-fix/manifest

## Capabilities

- Explains why Windows POSIX shells show garbled Chinese or Unicode output.
- Recommends UTF-8 output settings for Python commands and sessions.
- Shows how to set Windows PowerShell console output encoding.
- Provides a GBK decoding bridge for cmd.exe and native Windows tools.
- Includes local verification steps for Claude Code, Codex CLI, and similar agents.

## Use Cases

- Repair Garbled Agent Output: Fix unreadable Chinese or Unicode text when an AI coding agent runs commands in Git Bash or MSYS2.
- Standardize Terminal Setup: Document repeatable UTF-8 settings for teams that use Codex CLI, Claude Code, or Cursor on Windows.
- Diagnose Encoding Reports: Identify whether Python, Windows PowerShell, or cmd.exe is causing garbled terminal output.

## Prompt Templates

### Fix Garbled Output

```
Use charset-fix to repair garbled Chinese output from my AI agent in Windows Git Bash.
```

### Configure Python Session

```
Use charset-fix to make Python output UTF-8 for this Windows POSIX shell session.
```

### Diagnose Tool Source

```
Use charset-fix to determine whether Python, PowerShell, or cmd.exe is causing unreadable Chinese text.
```

### Create Team Guidance

```
Use charset-fix to create a safe team procedure for Windows AI agent encoding checks and verification.
```

## Limitations

- Only targets Windows environments that mix POSIX shells with Windows-native tools.
- Does not change system locale or permanent Windows code page settings.
- PowerShell Core usually needs no fix because it defaults to UTF-8.
- The helper script runs local diagnostic commands when users start it.

## Best Practices

- Apply the smallest encoding fix needed for the affected tool.
- Verify output with a short Chinese and Unicode text sample.
- Keep fixes session-scoped unless the team has tested permanent changes.

## Anti Patterns

- Do not change the whole system locale to fix one terminal session.
- Do not assume every Windows shell uses the same output encoding.
- Do not paste diagnostic commands from untrusted sources without review.

## Security Audit

- Audited at: 2026-07-05T15:41:02.699\+00:00
- Summary: The static findings are explained by documentation, examples, and hardcoded local diagnostic commands for Windows encoding. I found no prompt injection, data exfiltration, obfuscation payload, or user-controlled command execution evidence.

## Stats

- Views: 70
- Downloads: 11
- Favorites: 0
- Popularity score: 0
