Repair wrongly encoded UTF-8 characters

From a database, an email or a web page: paste the broken text and Mojibuster turns é, € and “ back into é, € and “.

Works with text and these files:

  • CSV
  • TXT
  • JSON
  • XML
  • SRT
  • VTT
  • SMI
  • TSV
  • MD
  • HTML
  • SQL
  • LOG

For example Excel exports, database dumps, subtitles or website code.

Repair

  1. Drop a file or paste text
  2. It gets repaired automatically
  3. Copy or download
or simply drag a file here

What is mojibake?

Mojibake is garbled text that appears when text is saved in one encoding and read in another. Most often, UTF-8 is wrongly read as Windows-1252 or ISO-8859-1. Every byte of a special character then shows up as a character of its own.

Common causes

  • The database connection uses latin1 although the data is UTF-8. For WordPress, see WordPress & database.
  • The web server sends charset=ISO-8859-1, but the page is saved as UTF-8.
  • An email client or newsletter tool declares the wrong encoding – for example in Outlook.
  • Text is copied between programs that expect different encodings.

Double-broken: é

If already broken text is converted wrongly once more, you get double mojibake: é first becomes é, then é. Mojibuster detects these levels too and repairs up to three at once. More: fix double-encoded UTF-8.

For developers: fix the cause

  • Set <meta charset="utf-8"> in HTML and send the header Content-Type: text/html; charset=utf-8.
  • Use utf8mb4 in MySQL and MariaDB for tables and the connection (SET NAMES utf8mb4) – details in MySQL and phpMyAdmin.
  • Save source files as UTF-8 without a BOM.
  • Convert text only once – at the boundary between your system and the outside world.
  • Always state the encoding in scripts – guides for PowerShell, Python with pandas and Notepad++.

Frequently asked questions

What does the � character mean?

That’s the replacement character U+FFFD. A program inserts it when it couldn’t read a byte. The original character is lost then – Mojibuster tells you how many spots are affected. More on question marks instead of characters.

Can I convert HTML codes like &eacute; too?

Yes. Switch on Also convert codes. HTML codes like &eacute;, &#233; and &#xE9; are then turned into real characters – and so are URL codes (%C3%A9), e-mail codes (=C3=A9), escape sequences (\u00e9) and Base64. When the tool finds such codes, it offers to convert them.

Is my text stored?

No. The repair runs in your browser. The text is neither transferred nor stored.

Does this work with other languages?

Yes. Mojibuster repairs every character that was misread from UTF-8 – for example French accents, German umlauts, emojis or Japanese script.

More guides