Where the word comes from
Mojibake (文字化け) is Japanese: “moji” means “character” and “bake” means “transformation”. In the 1990s, Japanese computers used several encodings side by side – Shift_JIS, EUC-JP and ISO-2022-JP – so garbled e-mails and web pages were an everyday sight. The word stuck and moved into English.
How mojibake happens
Computers store text as bytes. An encoding defines which bytes stand for which character. In UTF-8, é is stored as the two bytes C3 A9. A program that reads these bytes as Windows-1252 shows one character per byte: Ã for C3 and © for A9.
Nothing is lost in this step – the bytes are still there, they are only read the wrong way. That is why mojibake can usually be undone: Mojibuster turns the wrong characters back into bytes and reads them correctly.
Mojibake
Café, naïve, résumé – €5
Repaired
Café, naïve, résumé – €5
Mojibake in other languages
- Japanese:
縺薙s縺ォ縺。縺ッinstead ofこんにちは– UTF-8 read as Shift_JIS. More on the Japanese page. - Chinese:
浣犲ソinstead of你好– UTF-8 read as GBK. In Chinese it is called 乱码 (luànmǎ, “chaotic code”). - Russian:
Приветinstead ofПривет– UTF-8 read as Windows-1251. Russians call it “krakozyabry”. - Western languages:
ä,ñor€instead ofä,ñor€– the most common form worldwide.
Typical causes
- Excel opens a UTF-8 CSV file without a BOM as ANSI: fix special characters in Excel.
- A database connection uses
latin1while the data is UTF-8: WordPress & database. - A website or e-mail declares the wrong
charset– for e-mails, see the Outlook guide. - Subtitles were saved in an old code page: convert SRT to UTF-8.
- Text that is already broken gets converted again – double mojibake like
é: fix double-encoded UTF-8.
Can mojibake always be fixed?
Almost always, as long as the bytes are still intact. It becomes impossible once a program has replaced the characters with ? or the replacement character � – the original information is gone then. Mojibuster repairs everything that can be repaired and tells you how many spots are lost. More: question marks instead of characters.
How to prevent mojibake
- Save files as UTF-8 – CSV files for Excel as UTF-8 with BOM.
- Declare the encoding:
<meta charset="utf-8">in HTML,utf8mb4in MySQL and MariaDB. - Convert text only once, at the boundary between two systems.
- When importing, choose the encoding explicitly instead of letting the program guess.
Frequently asked questions
How do you pronounce mojibake?
Roughly “MO-jee-bah-keh”, with all four syllables spoken. The Japanese word has no stress accent like English words.
Is my file damaged or infected?
No. Mojibake is a display problem, not a virus and usually no data loss. The file is only read with the wrong encoding.
What is the difference between mojibake and �?
Mojibake like é still contains the original bytes and can be repaired. The character � means a program could not read a byte and replaced it – that character is lost.
Is my text uploaded?
No. Mojibuster repairs the text in your browser. It is neither transferred nor stored.