# Mojibake Repair: Undo Broken Encoding Exactly

Mojibake Repair: Undo Broken Encoding Exactly is a tested SKILL.md that repairs mojibake, text whose accents, Cyrillic letters, quotes, dashes or emoji turned into strings such as Ã¨, Ã¼, â€œ, Ð¿Ñ€ or Р—Рґ because UTF-8 was read as Windows-1252, Latin-1 or Windows-1251, once or twice; an agent buys it once for $0.01 over x402.

- Page: https://aiskills402.com/skills/mojibake-repair
- Category: Data & Analysis (https://aiskills402.com/categories/data)
- Price: $0.01 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/mojibake-repair

## Use it when

Repairs mojibake, text whose accents, Cyrillic letters, quotes, dashes or emoji turned into strings such as Ã¨, Ã¼, â€œ, Ð¿Ñ€ or Р—Рґ because UTF-8 was read as Windows-1252, Latin-1 or Windows-1251, once or twice. Gives back the original text exactly, character for character, by undoing the wrong reading byte by byte, and leaves text that is already correct untouched. When the damage is mixed with good text, mixes two encodings, or lost bytes, so that more than one original is possible, it answers with a fixed CANNOT REPAIR line instead of guessing. Use when text from a file, database, email, web page or export shows garbled characters, or when asked to fix, undo or decode broken encoding, double encoding or strange characters.

## Not for

Spelling or grammar correction, translation, restoring letters replaced by question marks, or text only partly damaged. Correct text comes back unchanged; text with more than one possible original gets a CANNOT REPAIR line instead of a guess. Windows-1251 Cyrillic saved byte per letter is restored only when the task names that code page.

## Tested, honestly

Tested 2026-10-09.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 21, checked by code character by character: Windows-1252 and Latin-1 damage in German and French, Cyrillic read as Windows-1252 and as Windows-1251, a Windows-1251 origin when the task names it, emoji, a CSV cell, a JSON line, double damage, a planted instruction, five texts that were already correct left untouched, and a CANNOT REPAIR line on six ambiguous inputs (mixed lines, two encodings, a replacement character, question marks, a lost invisible byte, a Windows-1251 origin the task does not name).
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on 20 of 21, checked by code character by character, but when the task said the text was written in Windows-1251 it returned the damaged text unchanged.

Note: Twenty-one texts written by us in English, German, French, Portuguese and Bulgarian: 10 damaged texts with one possible original, 6 ambiguous ones that must be refused, and 5 that are already correct. Every damaged text is made by our script from a known original, and each answer is compared with it character by character. Three more cases were built and dropped: the command line we test through strips the characters U+0080 to U+009F and carriage returns before the model sees them (measured: A U+009F B U+0090 C sent, A B C seen), so the invisible-partner and CRLF rules are not tested here. One check was widened for both sides: a refusal that names example words such as Müller is no longer read as a repair. The refusal rules follow from the encodings; nothing was owner-measured. One run per model and text.

### With and without the skill

Tested 2026-10-09.

- Texts restored exactly (15 with one possible original): Sonnet 15/15 with, 15/15 without; Haiku 14/15 with, 15/15 without.
- Ambiguous texts refused, not guessed (6): Sonnet 6/6 with, 1/6 without; Haiku 6/6 with, 1/6 without.

Same request on both sides; it asks for the original text and for one sentence instead of a guess when the text cannot be restored with certainty. Sonnet without the skill restored every text with one possible original. On five of the six ambiguous ones it restored the text anyway, and each guess matched the original we started from; the skill refuses there by design, because another original is possible. Counted as a gain only in the second row, so the price rests on the first. Haiku behaved the same way without the skill, and with it slipped once on a named Windows-1251 origin.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

Full summary: https://aiskills402.com/skills/mojibake-repair/tests

## Example

### German (claude-sonnet-5-5)

Before:

> GrÃ¶ÃŸe: MÃ¼ller & SÃ¶hne GmbH, StraÃŸe 12 â€” Ã–ffnungszeiten: Moâ€“Fr 9â€“18 Uhr, Ã„pfel fÃ¼r 3,50 â‚¬

After:

> Größe: Müller & Söhne GmbH, Straße 12 — Öffnungszeiten: Mo–Fr 9–18 Uhr, Äpfel für 3,50 €

### French (claude-sonnet-5-5)

Before:

> CafÃ© crÃ¨me Ã  la franÃ§aise : Â« OÃ¹ Ã§a ? Â» dit-elle, dÃ©jÃ  prÃªte.

After:

> Café crème à la française : « Où ça ? » dit-elle, déjà prête.

### Bulgarian (claude-sonnet-5-5)

Before:

> Ð¿Ñ€Ð¸Ð²ÐµÑ‚, Ð¼Ð¸Ñ€! Ð¦ÐµÐ½Ð°: 1 250 Ð»Ð². Ð”Ð¾Ð±Ñ€Ð¾ Ð¿Ð¾Ð¶Ð°Ð»Ð¾Ð²Ð°Ñ‚ÑŒ Ð² ÐŸÐ»Ð¾Ð²Ð´Ð¸Ð².

After:

> привет, мир! Цена: 1 250 лв. Добро пожаловать в Пловдив.

### English (claude-sonnet-5-5)

Before:

> sku,note,qty A-1,â€˜Quoteâ€™ cafÃ©,3 B-2,plain,4

After:

> sku,note,qty A-1,‘Quote’ café,3 B-2,plain,4

### Portuguese (claude-sonnet-5-5)

Before:

> São Paulo – naïve café

After:

> São Paulo – naïve café

## What is in the file

- Hard rules
- How the damage works
- What stays untouched
- Already correct text
- Work in this order
- Short examples

## Languages

Any language

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/mojibake-repair/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 12.2 KB (12527 bytes)
- SHA-256: 57947451e8666ddd97ae3c0bbd9a3b9f4cea5f8438f55dfbfcf3ae690259938f
- Updated: 2026-10-09
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-09)

First release: undoes UTF-8 read as Windows-1252, Latin-1 or Windows-1251, once or twice, byte for byte; returns correct text unchanged; refuses mixed, lossy or ambiguous text with a fixed `CANNOT REPAIR:` line. Price set provisionally at $0.05 until the model test.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### How does it treat text that is only partly garbled?

It answers with a CANNOT REPAIR line. If one line is damaged and the next is already correct, nobody can tell afterwards which parts were changed, so the skill refuses instead of repairing some lines and leaving the rest as they were. The same line is the answer for two encodings mixed in one text. This all-or-nothing rule is deliberate: a repaired export that quietly mixes fixed and untouched rows is harder to audit than one that stops with a reason you can read. Reviewers get a clear reason.

### Can it restore letters that turned into question marks or replacement characters?

No. Once the bytes were replaced, the original is gone and several letters would fit each place, so the answer is a CANNOT REPAIR line that a program can detect with a simple prefix test. A Cyrillic capital that lost its invisible half is refused for the same reason: the lead character alone could be any of sixteen letters. Typical sources are exports saved through an ASCII-only step, copy and paste that strips control characters, and databases that substituted a placeholder for anything they could not store.

### Which damage does it undo, and what does it leave alone?

UTF-8 read as Windows-1252 or Latin-1 (German, French, Spanish, Turkish, dashes, curly quotes, emoji), Cyrillic read as Windows-1252 or Windows-1251, and the same damage applied twice. Text that is already correct, such as real accents, Cyrillic, or look-alikes like SÃO PAULO and 25°, comes back exactly as it came, with no note and no code fence. The answer is the restored text alone, so it can be written straight back to a file or a database field. Damage that was applied three or more times is reversed layer by layer until ordinary text appears.

### Does it help Claude Sonnet?

Not where the text can be restored, hence one cent. Sonnet and Haiku each repaired twenty-one texts, file present and file absent, and our script held every output against its original letter by letter. On the fifteen with one possible original, plain Sonnet was already exact. On six ambiguous ones the file makes it answer CANNOT REPAIR; plain Sonnet restored five of them anyway, and every guess matched. The file trades such guesses for a refusal a program can detect. Invisible control bytes could not be tested: our command line strips them.

## Related skills

- [JSON Repair: Fix Broken JSON, Keep Every Value](https://aiskills402.com/skills/json-repair.md): $0.05 once
- [CSV Repair: Fix Broken CSV, Keep Every Cell](https://aiskills402.com/skills/csv-repair.md): $0.05 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
