encoding-guard

Detect mojibake and suspicious text-loss regressions in UTF-8 source files.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/muddyrain/valley-mas --skill encoding-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: encoding-guard
Source: https://github.com/muddyrain/valley-mas/tree/main/.codex/skills/encoding-guard
Command: npx skills add https://github.com/muddyrain/valley-mas --skill encoding-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill helps prevent encoding corruption and silent text loss when editing source files containing non-ASCII text (e.g., Chinese, Japanese, Korean). It guards against Mojibake and unexpected replacement of user-visible text during edits.

Core Features & Use Cases

  • Seamless detection of mojibake with actionable recovery guidance.
  • Detection of suspicious text-loss such as repeated '?' in user-visible strings or JSX-like content.
  • Safe editing workflow guidance, including pre- and post-edit checks and corrective recommendations.

Quick Start

Run this tool before and after edits to detect mojibake and suspicious text-loss with python .codex/skills/encoding-guard/scripts/check_mojibake.py.

Frequently Asked Questions about encoding-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect mojibake and text loss in UTF-8 source files?

To detect mojibake and text loss in UTF-8 source files, run a Python-based script that parses current changes against HEAD and reports actionable findings regarding encoding corruption and suspicious text replacement.

What causes mojibake in multilingual codebases?

Mojibake in multilingual codebases occurs when UTF-8 source files containing non-ASCII text like Chinese, Japanese, or Korean are edited with incorrect encoding settings, leading to silent corruption and unexpected replacement of user-visible strings.

How do I prevent silent text loss when editing non-ASCII source code?

Prevent silent text loss by running encoding checks before and after edits to detect suspicious regressions like repeated question marks in user-visible strings or JSX-like content, ensuring safe editing workflow guidance.

Can I check specific Git commits for suspicious text-loss regressions?

Yes, you can check specific commits for text-loss regressions by parsing and comparing current changes against the HEAD revision to identify suspicious replacements of user-visible text in multilingual codebases.

Does encoding detection work without installing external dependencies?

Yes, encoding detection works without external dependencies because the Skill relies on built-in Python-based scripts to parse files and identify suspicious text-loss regressions and mojibake within your repository.

Why does my source file show repeated question marks after editing?

Repeated question marks in source files indicate suspicious text-loss regressions where non-ASCII characters were unexpectedly replaced, which this tool detects by comparing current edits against HEAD to provide recovery guidance.