Scan, fix, and verify file encoding issues across your project in one command.
Fixes mojibake, BOM, CRLF line endings, null bytes, and non-UTF-8 encoding — automatically detected and repaired, with backups created before every change.
Built from real encoding bugs found in production Python projects on Windows.
pip install encoding-doctor# Step 1 — scan first, always
enc-doctor scan ./my_project
# Step 2 — preview changes without writing
enc-doctor fix ./my_project --dry-run
# Step 3 — fix (backups created automatically as .bak)
enc-doctor fix ./my_project
# Step 4 — verify everything is clean
enc-doctor verify ./my_project| Command | Access |
|---|---|
scan |
✅ Free forever |
fix |
🔑 Requires license |
verify |
🔑 Requires license |
restore |
🔑 Requires license |
# Activate your license
enc-doctor activate <YOUR-KEY>
# Check license status
enc-doctor license
# Deactivate (free up seat for another machine)
enc-doctor deactivateGet your license → stateflow.dev/encoding-doctor
| Problem | Description |
|---|---|
| Mojibake | UTF-8 bytes mis-read as cp1252 and saved as garbage |
| BOM | \xef\xbb\xbf prefix added by Notepad/Excel that breaks parsers |
| CRLF | Windows \r\n mixed with Unix \n — causes Git diff noise |
| Null bytes | Binary corruption from FTP or terminal copy-paste |
| Non-UTF-8 | Detected and flagged for manual conversion |
encoding-doctor modifies files in-place.
- Always run
scanfirst and review the report before runningfix.- Backups are created automatically as
.bakfiles.- Run on a Git-tracked project so you can always revert with
git checkout .- Do not run
fixon production files without testing first.verifyafter every fix before committing.
enc-doctor scan <path> [--all] # --all shows clean files too
enc-doctor fix <path> [--dry-run] # --dry-run previews without writing
enc-doctor verify <path>
enc-doctor restore <file> # restore single file from .bakpip install pytest
pytest tests/ -vMIT © Stateflow Labs