CSV / mojibake diagnosis guide
Diagnose CSV mojibake and hand off a verified file
When text is unreadable, first separate encoding, BOM, and delimiter issues. A readable display is different from a later number or date conversion. Keep the original, export as UTF-8, then reopen the saved file and verify it.
Separate the first three causes
| Symptom | First check | Next action |
|---|
| Text like ã‚ã„ㆠ| Encoding used to read bytes | Compare UTF-8 with CP932/Shift_JIS |
| Columns shift | Delimiter, quote, and newline rules | Check comma, tab, or semicolon |
| Readable text but 001 becomes 1 | Later type conversion | Re-import the ID as text |
A UTF-8 BOM can help some readers identify encoding, but it is not a universal guarantee.
Reproduce the boundary with fixtures
utf8.csv is a UTF-8 positive case. diagnostic.csv shows mojibake, delimiter and type-conversion clues. Expected values are 2 rows, 3 columns, amount total 2180, and string IDs.
id,name,amount
001,山田太郎,1200
002,佐藤花子,980
If the original uses another encoding, record what you used to open it before exporting to UTF-8. Do not guess from a damaged display.
A safe handoff with Web-Tool
- Keep the original CSV and make a working copy.
- Open Table to Excel, then inspect encoding, delimiter and column types.
- Export as UTF-8 and reopen the saved file with an independent reader.
- Give the recipient the encoding, BOM, delimiter and verification result.
This guide and Table to Excel work in the browser. Source files and input are not sent to a URL, analytics, or an external server.
Cases that cannot be restored
If the wrong encoding already caused bytes to be lost, do not reconstruct the text by guesswork. Retrieve the original. Fixing encoding also does not fix leading-zero or long-ID type conversion; check that separately.