c-encoding: Avoiding Mojibake in Chinese Comments When an Agent Edits C Source Code

c-encoding is a SkillHub community Skill that enforces an encoding-safe editing workflow whenever an Agent uses Edit or Write to modify `.c` or `.h` files. It automatically detects the original file encoding, converts the content to UTF-8 before making changes, and restores the original encoding afterward—preventing Chinese comments in legacy projects (e.g., GB2312) from being corrupted. The process consists of four steps and relies on PowerShell for BOM detection and heuristic encoding identification. It can be installed via `skillhub install @user_a8bb82de/c-encoding` or through the official Zip package. Ideal for maintaining C codebases containing Chinese comments on Windows with AI assistance.

Read More