# Encoding Fix

> Mojibake-Reparatur für doppelt/dreifach kodiertes UTF-8. Behebt Windows-cp1252/Latin-1-Fehlinterpretationen. Ohne Abhängigkeiten.

- Skill: `ellmos-ai/encoding-fix` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add ellmos-ai/encoding-fix`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ellmos-ai/encoding-fix/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ellmos-ai (https://skillmd.com/u/ellmos-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ellmos-ai/encoding-fix

---

<img src="banner.png" width="100%" alt="encoding-fix banner">

# Encoding Fix

Repariert Mojibake (doppelt/dreifach kodiertes UTF-8) das durch Windows cp1252/Latin-1
Fehlinterpretation entsteht. Zero Dependencies — nur Python stdlib.

## Typisches Problem

```
"ue" (U+00FC) → UTF-8 \xc3\xbc → als cp1252 gelesen → "Ã¼"
```

## Nutzung

### Als Library
```python
from encoding_fix import sanitize_outbound

clean = sanitize_outbound("WÃ¼rge")  # → "Würge"
```

### Subprocess-Output
```python
from encoding_fix import sanitize_subprocess_output

text = sanitize_subprocess_output(process.stdout)
```

### CLI
```bash
python encoding_fix.py "WÃ¼rge"    # Einzelnen String prüfen
python encoding_fix.py              # Selbst-Test
```

## Features

- **Idempotent:** Korrekt kodierter Text wird nicht veraendert
- **Bis zu 3 Runden:** Repariert auch dreifach-kodierte Strings
- **Subprocess-Dekoder:** UTF-8/cp1252 Fallback fuer Prozess-Output
- **Zero Dependencies:** Nur Python stdlib

## Changelog

### 1.0.0 (2026-03-12)
- Portiert aus BACH system/tools/encoding_fix.py

