Match the symptom
| Symptom | Likely cause |
|---|---|
café instead of café | UTF-8 decoded as Windows-1252 |
| All values in one column | Wrong delimiter: comma vs semicolon, tab or pipe |
| Columns shift mid-file | Broken quoting, embedded newline, or ragged row |
00123 becomes 123 | Automatic numeric conversion |
| Long ID becomes scientific notation | Spreadsheet type inference |
What UTF-8 actually changes
CSV defines rows, delimiters and quoting; it does not reliably announce its character encoding. UTF-8 can represent the full Unicode range, but a viewer must choose it. A UTF-8 byte-order mark sometimes helps spreadsheet importers, though it is not part of the data itself.
Diagnose before saving
- Keep a copy of the original bytes.
- Try UTF-8 first, then the known source encoding.
- Confirm the delimiter using several rows, not only the header.
- Inspect quoted commas and embedded newlines.
- Check identifiers, dates and long numbers before exporting.
With csvlite, cell display text is preserved while inferred types are used only for sorting, filtering and profiling. It supports a manual encoding override and delimiter detection for common separated formats.