CSV and imports

Fix Garbled Characters and Broken CSV Imports (UTF-8)

By the DecodingPro teamUpdated 7 min read

Quick answer

Save and exchange CSV files as UTF-8, open them with Data, From Text/CSV (not by double-clicking) so you can choose the encoding and the delimiter, and import identifier columns such as phone numbers, ZIP codes and IDs as Text. Garbled characters like é mean UTF-8 text was read as Windows-1252; re-open the original file with the encoding set to 65001 UTF-8 instead of trying to repair the damaged copy.

A CSV is the universal way to move spreadsheet data between systems, and also one of the most common reasons an import fails. The format looks trivial (values separated by commas) but it carries no information about its own text encoding, delimiter or column types. Every program that opens it has to guess. This guide explains the guesses that go wrong and how to take control of them.

What a CSV file actually is

A CSV is plain text: one record per line, fields separated by a delimiter, usually a comma. RFC 4180, the closest thing to a specification, recommends that fields containing commas, double quotes or line breaks be enclosed in double quotes, and says that a double quote inside a quoted field is written as two double quotes. A header line with column names is optional. Everything else (encoding, how to write dates, which delimiter, what is a number) is left to the programs on each end.

id,name,address
001,"Smith, John","12 Oak Street
Apartment 4"
002,"Anna ""Ann"" Lee",Berlin

Note that 001 is just three characters. Nothing in the file says it should stay text, which is why Excel may turn it into the number 1.

Problem 1: é, ’ and other garbled characters

This is called mojibake. It happens when text written in one encoding is read as another. The usual case: a file saved as UTF-8 (where "é" takes two bytes) is read as Windows-1252, a single-byte encoding, so each byte is shown as its own character. The two bytes of "é" become é.

You wantedYou seeYou wantedYou see
éé’ (curly apostrophe)’
èè“ (opening quote)“
ññ– (en dash)–
üü— (em dash)—
öö… (ellipsis)…
ää€â‚¬
çç° (degree)°
© (copyright)©£Â£

A real example: "José Martínez" arrives as José Martínez. The telltale sign is the pattern: a capital à or  followed by an odd symbol, or †followed by a symbol, where an accented letter or punctuation mark should be.

The fix: re-open the original with the right encoding

  1. Do not edit or save the damaged workbook. Go back to the original CSV file.
  2. In Excel choose Data, From Text/CSV and select the file.
  3. In the preview window set File Origin to 65001: Unicode (UTF-8). The preview updates immediately; if the characters look right, click Load.
  4. If they still look wrong, try other origins in turn. A file from an old Windows system may genuinely be Windows-1252, and one from another region may be a different legacy encoding.

Double-clicking a CSV skips all of this. Excel then picks an encoding itself, and UTF-8 files without a byte-order mark (BOM) are commonly misread.

Saving. To produce a file other systems will read correctly, use File, Save As, CSV UTF-8 (Comma delimited) (*.csv). The plain CSV (Comma delimited) option saves with your system's legacy code page, and characters outside it are replaced with question marks, which cannot be recovered.

If only a damaged copy exists, the text can sometimes be repaired by reversing the mistake (encode as Windows-1252, decode as UTF-8). Free tools such as the open-source Python library ftfy do this automatically. If the characters were already replaced by ? or �, the information is gone and only the original will do.

Problem 2: everything lands in one column

In many European locales the comma is the decimal mark, so those versions of Excel use a semicolon as the list separator and expect it in CSV files (and write it when saving). A comma-separated file opened there shows each row as one cell, and a semicolon-separated file opened on a US machine does the same. The delimiter Excel assumes comes from the regional "list separator" setting of your operating system.

  • Fix on open: use Data, From Text/CSV and choose the delimiter in the preview. Or select the column and use Data, Text to Columns, Delimited and tick the right separator.
  • Fix at the source: agree one format with whoever supplies the file and write it in your import instructions.
  • Danger sign: if decimals are written with commas (1250,50) in a comma-delimited file, the numbers must be quoted or the columns shift.

Problem 3: leading zeros, long numbers and surprise dates

When Excel loads a CSV it converts what looks like a number or a date. That is why 00123 becomes 123, 1234567890123456 becomes 1234567890123450 (Excel stores 15 significant digits) and 3-4 becomes a date. To stop it:

  1. Open the file with Data, From Text/CSV.
  2. In the preview set Data Type Detection to Do not detect data types. Everything arrives as text.
  3. Click Transform Data only if you want to set specific columns to numbers or dates afterwards.
  4. Load, and keep identifier columns (phone numbers, ZIP codes, account numbers, SKUs) as Text.

When you save a workbook as CSV, what you see is what is written: if a leading zero was already lost inside the workbook, the CSV carries the loss with it. And when the receiving program opens that CSV, it may strip the zeros again, so it is worth testing with a small file first.

Problem 4: line breaks and quotes inside cells

An address typed with Alt+Enter contains a line break. In a correct CSV that field is wrapped in double quotes, so one record spans two lines. A program that does not understand the quoting splits the record into two broken rows. A stray single double quote has a similar effect, because the parser treats everything after it as one long quoted field.

  • Symptom: row counts that do not match, rows with too few or too many columns, or the last columns filled for some rows only.
  • Check: after import, compare the count of rows with the source, and test that every row has a value in a column that should never be empty (such as an ID).
  • Fix: replace line breaks inside cells before export: =SUBSTITUTE(SUBSTITUTE(A2,CHAR(10)," "),CHAR(13)," ").

Problem 5: things a CSV cannot hold

In the spreadsheetIn the CSVDo this before export
Several sheetsOnly the active sheet is savedExport one CSV per sheet
Merged cellsOnly the top-left cell keeps its valueUnmerge and fill the values down
Title rows, notes, subtotalsWritten as data rowsKeep one header row and the records, nothing else
FormulasOnly the displayed resultConvert to values and check
Hidden columns or filtered rowsHidden columns are written; check your version's behavior with filtersUnhide and clear filters, then verify the output
Cell formatting (colors, bold)LostDo not use colors to carry meaning; add a column

Problem 6: email lists

Email columns collect their own set of defects. After trimming spaces and lowercasing, look for:

  • A missing @ or a missing dot in the domain.
  • Two addresses in one cell, separated by a comma, semicolon or slash.
  • Text around the address: mailto:anna@mail.com, Anna <anna@mail.com>.
  • Typos in popular domains: gmial.com, gmai.com, gmail.con, hotmial.com, yaho.com. A short lookup of known-wrong and right domains fixes most.

Syntax checks only prove that an address is shaped correctly. Whether a mailbox exists can only be learned from the mail provider, so expect some bounces even from a clean list.

Skip the encoding detective work.

DecodingPro reads Excel and CSV files, repairs the classic garbled-character patterns, standardizes dates, phone numbers and emails, flags duplicates and anything unclear, and gives you a clean workbook with every change logged. 100 free credits, no card.

Clean a file free

Import-ready checklist

  1. One header row with unique, plain column names. No merged cells, no title rows, no totals.
  2. UTF-8 encoding, and the delimiter the target expects.
  3. Identifiers as text: phone numbers (E.164 if the target accepts it), ZIP codes, IDs, account numbers.
  4. Dates in ISO form, yyyy-mm-dd (see the dates guide).
  5. No leading or trailing spaces, consistent capitalization, one value per cell.
  6. No duplicates on the key the target uses (see the duplicates guide).
  7. Valid emails, typo domains fixed.
  8. Row and size limits of the target system respected; check its documentation.
  9. Test with ten rows first. Import a small sample, open the result, and compare it with the source before importing everything.

Frequently asked questions

Why does my CSV show é instead of é?

The file is UTF-8 but was read as Windows-1252. Re-open the original with Data, From Text/CSV and set File Origin to 65001: Unicode (UTF-8).

How do I save a CSV as UTF-8 in Excel?

Choose File, Save As, then "CSV UTF-8 (Comma delimited) (*.csv)" in the file type list. The plain "CSV (Comma delimited)" option uses a legacy code page.

Why is all my data in one column when I open a CSV?

The delimiter in the file does not match your system's list separator (for example a semicolon file on a comma system). Open it with Data, From Text/CSV and choose the delimiter, or use Text to Columns.

How do I keep leading zeros when I open a CSV in Excel?

Open it with Data, From Text/CSV and set Data Type Detection to "Do not detect data types", or import the column as Text. Double-clicking the file lets Excel convert the values.

What makes a spreadsheet ready to import into a CRM or email tool?

A single header row, UTF-8 encoding, consistent formats for dates, phone numbers and emails, text-typed IDs, no duplicates on the matching key, and a small test import before the full one.

Sources

  1. RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files
  2. Microsoft: Import or export text (.txt or .csv) files
  3. Mojibake (garbled text caused by mismatched character encodings)
  4. Microsoft: Excel specifications and limits (15-digit number precision)
  5. ftfy: fixes text for you (open-source mojibake repair)

Keep reading

01Excel data cleaningHow to Clean Messy Excel Data: A Step-by-Step GuideThe fixed order that stops one fix from undoing another, with the formulas for every step.10 min read02Text and numbersHow to Keep Leading Zeros in Excel and CSV (ZIP Codes, IDs)Why Excel turns 02134 into 2134, how to get the zeros back, and how to stop it happening when you open a CSV.5 min read03CSV and importsHow to Clean a CSV File Before Importing It Into a CRMSeven fixes that prevent duplicate contacts, rejected rows and scrambled characters, and the 10-row test to run first.4 min read04DatesHow to Fix Dates in Excel and CSV Files (Mixed Formats)Text dates, day-month swaps, two-digit years and the one rule that makes dates safe to share.8 min read05Phone numbersHow to Fix Phone Numbers in Excel: Format and Country CodesLeading zeros, 9.19E+11, country codes and the international format that every system accepts.6 min read06DuplicatesHow to Remove Duplicates in Excel Without Losing DataExact, near and partial duplicates: decide what counts, mark before you delete, keep the best record.6 min read07DuplicatesHow to Find and Highlight Duplicates in ExcelFind repeats safely first: highlight them, count them, keep the first one, and spot the near-duplicates Excel does not see.3 min read08NamesHow to Standardize Names in Excel: Proper Case and ExceptionsWhat PROPER gets wrong, how to protect names that are already right, and how to flip "Smith, John" into "John Smith".4 min read09Email addressesHow to Fix Email Typos in Excel: gmial.com, .con and Missing @The typos that make campaigns bounce, and the formulas and checks that fix them without guessing.4 min read10Email addressesHow to Clean an Email List Before You Send a CampaignA five-step routine that removes the avoidable bounces from a list without deleting anyone you should keep.3 min read11NamesHow to Split Full Names into First and Last Name in ExcelFlash Fill, Text to Columns and formulas for splitting names, and the names that trip each one up.4 min read12Text cleanupHow to Remove Extra Spaces in Excel (TRIM, CLEAN and Non-Breaking Spaces)Why TRIM sometimes does nothing, and the one formula that removes every kind of stray space.3 min read13Text cleanupHow to Remove Special Characters and Line Breaks in ExcelThe characters you cannot see, the smart quotes you can, and the exact formula or shortcut that removes each one.4 min read14NumbersHow to Convert Text to Numbers in Excel (Numbers Stored as Text)Why sums show zero, why numbers sit on the left, and four ways to turn text back into real numbers.3 min read15Excel data cleaningHow to Clean Data with Power Query in Excel (Step by Step)Record your cleaning steps once and replay them on every new file, without formulas and without touching the original data.4 min read16Comparing dataHow to Compare Two Lists in Excel and Find What Is MissingFind the names, IDs or emails that are in one list and not the other, with formulas that scale.3 min read18Data entryData Entry Accuracy: How to Check, Measure and Improve ItWhat the research says about error rates, why proofreading fails and the checks that actually work.9 min read