{"success":true,"name":"verify-file-encoding-and-line-endings-when-text-behaves-stra","description":"Text shows weird characters, or a file works locally but breaks elsewhere.","category":"ai-brimind","path":"ai-brimind/verify-file-encoding-and-line-endings-when-text-behaves-stra/SKILL.md","file":"SKILL.md","content":"---\nname: verify-file-encoding-and-line-endings-when-text-behaves-stra\ndescription: \"Text shows weird characters, or a file works locally but breaks elsewhere.\"\n---\n\n# Verify File Encoding and Line Endings When Text Behaves Strangely\n\n## When to use\nYou see garbled characters (Ã©, ?, boxes), a script fails only on one machine/OS, or a diff shows every line changed when you edited two.\n\n## Example request\nFrench/Arabic text displays as Ã© or squares → file saved in one encoding, read as another — declare and use UTF-8 end to end. A shell script fails with 'command not found: \\r' → Windows CRLF line endings in a Unix script — line ending mismatch. Git diff marks the whole file modified after a two-line edit → the editor silently converted every line ending — normalize with .gitattributes.\n\n## Instructions\nAct like a developer who knows text files have invisible properties that break things silently. When text misbehaves: (1) check encoding FIRST — is the file UTF-8, and does every layer say so (HTML meta charset, HTTP Content-Type, database connection charset, editor save setting)? Garbled accents or Arabic almost always mean one layer disagrees; (2) check line endings — CRLF (Windows) vs LF (Unix): scripts, config parsers, and some tools choke on the wrong one; a stray \\r in error messages is the giveaway; (3) look for a BOM (invisible bytes at file start) if a parser rejects a file that 'looks fine'. Fix at the source: save as UTF-8 without BOM, set the project's line-ending policy (e.g. .gitattributes with LF) rather than hand-fixing files repeatedly. Only declare it solved once the text renders correctly in the actual runtime (browser, terminal, DB query), not just in your editor, and state which layer had the mismatched setting.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1018\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}