1.1 KiB
1.1 KiB
AGENTS.md — Encoding & Chinese Safety Rules
Absolute rules (must follow)
- Never corrupt non-ASCII text (Chinese, emoji, etc.). Preserve exact Unicode characters.
- NEVER rewrite entire files when only small edits are needed. Always apply minimal diffs/patches.
- If a file contains Chinese characters, do not “normalize”, “escape”, “re-encode”, or “replace” them.
- When reading/writing files via scripts/tools, always use UTF-8 explicitly (no platform default encoding).
Windows / PowerShell rules
- If you need to run PowerShell, force UTF-8 output/input:
- Use:
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() - Prefer
Set-Content -Encoding utf8/Out-File -Encoding utf8
- Use:
- Avoid commands that may round-trip through ANSI/CP936/CP1252 without explicit encoding.
Workflow
- Before editing: inspect the target lines only.
- Apply changes as a patch (line-level edits), not full-file regeneration.
- After editing: verify the edited lines still show correct Chinese.
- If uncertain: stop and ask rather than guessing and corrupting text.