Japanese text turns into strings like 縺薙s縺ォ縺。縺ッ when it is written in one character encoding and read in another: a mail, a web page or a file opened the wrong way. Paste the garbled text here. The page undoes the misreading step by step and shows the repairs that read most like Japanese, the likeliest first. Your text never leaves your computer.
How to Use It
- Paste the garbled text. Into the box above. A long text works, and so do a few lines.
- Press “Repair”. The page tries every misreading that could have made the text, undoes it, and shows the results that read most like Japanese. The first is the likeliest.
- Copy the repair. Press “Copy” under a result to take the repaired text. “Show this repair” shows one of the others.
Examples
What you see, and what happened. Each of these is repaired by this page exactly as shown, except the last.
| What you see | What it was | What happened |
|---|---|---|
| 縺薙s縺ォ縺。縺ッ | こんにちは | UTF-8 read as Shift_JIS: the most common, a UTF-8 page or file opened on a Japanese Windows computer |
| 日本語 | 日本語 | UTF-8 read as Windows-1252 or ISO-8859-1, by a program or database set up for Western European text |
| 鏂囧瓧鍖栥亼 | 文字化け | UTF-8 read as GBK, an encoding for Chinese |
| ‚±‚ñ‚É‚¿‚Í | こんにちは | Shift_JIS read as Windows-1252: an older Japanese file or mail opened outside Japan |
| ¤³¤ó¤Ë¤Á¤Ï | こんにちは | EUC-JP read as Windows-1252 |
| 、ウ、タ、゙ | こだま | EUC-JP read as Shift_JIS |
| $B$3$s$K$A$O(B | こんにちは | ISO-2022-JP, the encoding of Japanese mail, with its invisible escape characters lost |
| ����ɂ��� | lost | Shift_JIS or EUC-JP read as UTF-8. The browser has replaced what it could not read with “�”, and those bytes are gone: open the original file again in its own encoding. |
The words are こんにちは (konnichiwa, hello), 日本語 (nihongo, Japanese), 文字化け (mojibake) and こだま (kodama, an echo).
What Mojibake Is
A computer keeps text as numbers, and an encoding says which number stands for which character. Japanese has had several in use: UTF-8 today, Shift_JIS on Windows computers and on the mobile phones of the 2000s, EUC-JP on Unix systems, and ISO-2022-JP in mail. Text written in one and read in another comes out as the wrong characters. In Japanese this is mojibake (文字化け): characters (文字, moji) that have changed their shape (化け, bake, as a fox or a ghost does in old Japanese stories).
In most cases nothing is lost. The numbers are all still there, only read the wrong way, so reading them back the right way brings the text back. Sometimes it was misread twice over, and the page undoes that too.
What It Can Repair, and What It Cannot
- UTF-8 read as Shift_JIS, EUC-JP, ISO-8859-1 or Windows-1252, or GBK
- Shift_JIS or EUC-JP read as Windows-1252, as each other, or as GBK
- ISO-2022-JP whose escape characters were lost, which shows as “$B…(B”, and the encoded headers of Japanese mail (“=?ISO-2022-JP?B?…?=”)
- The same misreading made twice or three times over
- Each line is tried on its own, so a text that mixes readable and garbled lines can be repaired too.
Example 1 is our own news item of 7 July 2010 (in Japanese), as a browser shows it when it reads the page as Shift_JIS.
Garbled text sometimes contains “�”. A browser puts this mark where it could not read the bytes, and what they held is lost. Only where UTF-8 was misread, the page guesses the likeliest character from the characters around it and marks it with a dotted underline. A guessed character can be wrong.
Shift_JIS or EUC-JP read as UTF-8 cannot be repaired from the text on the screen. Open the original file again and choose its encoding.
The frequencies and links of characters used for the guesses come from JMdict and KANJIDIC2 by the Electronic Dictionary Research and Development Group (EDRDG), under CC BY-SA 4.0: see the licence here.
Questions People Ask
Why do Japanese e-mails turn into garbled characters?
The mail was written in one encoding and read in another. Japanese mail was long sent in ISO-2022-JP or Shift_JIS, and many programs now expect UTF-8; a program that guesses wrong shows strings of odd letters, and one that drops the invisible escape characters of ISO-2022-JP shows strings such as “$B$3$s$K$A$O(B”. Paste the text here to read it, and set the mail program to show the message as Japanese.
Why does a Japanese CSV file look garbled in Excel?
Excel opens a CSV file in the computer’s own encoding unless the file says otherwise, so a UTF-8 file without a byte order mark is read as Shift_JIS on a Japanese computer, or as Windows-1252 on many others. Open it from Data, From Text/CSV, and choose 65001: Unicode (UTF-8) as its origin; or, where you make the file, save it as “CSV UTF-8”, which adds the mark.
Can it repair a whole file?
It repairs text pasted into the box, up to 20,000 characters, line by line. For a whole file, open it again in a text editor that lets you choose the encoding, and choose the one this page names in its repair.
Why does my text show “�”?
A browser or program puts “�” where it could not read the bytes, and what they held is lost. Where UTF-8 was misread, the page guesses the likeliest character from the ones around it and marks the guess. Shift_JIS or EUC-JP read as UTF-8 cannot be repaired from the screen: open the original file again and choose its encoding.
How do I find out which encoding a text was in?
Repair it here: each result names the misreading it undid, such as “UTF-8 read as Shift_JIS”. The first part is the encoding the text was written in, the second the one it was wrongly read in.
