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
latin1although 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 headerContent-Type: text/html; charset=utf-8. - Use
utf8mb4in 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 é too?
Yes. Switch on Also convert codes. HTML codes like é, é and é 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.