fix-unicode-decode — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fix-unicode-decode (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Treat encoding as a byte-to-text contract. Identify the byte source and actual encoding before changing code or files; never make an error disappear with errors="ignore" or an unverified bulk rewrite.
open, Path.read_text, CSV/JSON parser, subprocess, HTTP response, database driver, or terminal. python scripts/diagnose_encoding.py path/to/filelatin-1 and gb18030 accept many byte sequences.encoding= at file boundaries, configure subprocess or terminal encoding, or correct the producer when its declared charset is wrong.encoding="utf-8" in Python.utf-8-sig only when consuming or intentionally producing a UTF-8 BOM, commonly for Excel interoperability.gb18030 for legacy Simplified Chinese data only when provenance or byte evidence supports it. Prefer it over gbk for broader compatibility.utf-16 when a BOM is present. Without a BOM, establish endianness from the format or producer before choosing utf-16-le or utf-16-be.bytes as bytes until the correct boundary. Decode once and encode once.errors="replace" only for deliberate lossy display or telemetry and report the data loss. Never use it to migrate source data.U+FFFD unless the original bytes are available; the replacement may already have destroyed information.from pathlib import Path
text = Path(path).read_text(encoding="utf-8")
Path(path).write_text(text, encoding="utf-8", newline="\n")result = subprocess.run(
command,
capture_output=True,
text=True,
encoding="utf-8", # Match the child process, not a guess.
errors="strict",
check=True,
)For CSV, JSON, HTTP, Windows console, Git, and mojibake repair patterns, read references/encoding-playbook.md. Load only the relevant section.
errors="strict".中文,编码测试。 rather than only checking that no exception occurs.git diff --word-diff or a byte-level diff for unexpected churn.Run scripts/diagnose_encoding.py on one or more files. Add --json for machine-readable output or --encodings to test known producer-specific codecs. The script is read-only, uses strict decoding, and ranks candidates heuristically; treat its ranking as evidence, not certainty.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.