Sub topic 7
Character encoding and spreadsheet locale
Assume you can upload a CSV file, use File > Import, and read basic spreadsheet formulas. This chapter focuses on why imported characters, numbers, and dates sometimes look wrong even when the source file is valid.
Encoding and locale solve different problems
Character encoding describes how a file stores characters as bytes. Locale describes regional conventions for dates, decimal marks, thousands separators, and sometimes the meaning of delimiters.
For example, the word café must be decoded with the same encoding used to save it. If a UTF-8 file is read as another encoding, it may appear as café or contain replacement characters.
A locale affects values such as:
| Source text | Locale convention | Possible result |
|---|---|---|
| `1.234,56` | Germany | 1234.56 |
| `1.234,56` | United States | Text or an incorrectly interpreted value |
| `03/04/2026` | United States | March 4, 2026 |
| `03/04/2026` | United Kingdom | April 3, 2026 |
Encoding is about reading characters. Locale is about interpreting values after they are read.
How the two settings affect an import
When you import a delimited file with File > Import, Google Sheets may detect the character encoding and separator automatically. If the result contains garbled text, choose the encoding explicitly when the import dialog provides that option. UTF-8 is the usual choice for modern CSV files.
The separator must match the file. A comma-separated file uses commas between fields. A semicolon-separated file may be common in regions where the comma is the decimal mark. If the separator is wrong, an entire row may appear in one column, or values may split into unexpected columns.
The spreadsheet locale is separate from the file's encoding. Open File > Settings, choose the appropriate locale, and save the setting before checking dates and numbers. The locale influences:
- Which date order Sheets expects.
- Whether a period or comma is the decimal separator.
- How numbers display.
- Some default currency and time formats.
- How formulas use separators between arguments in some spreadsheet environments.
A locale setting does not repair garbled characters. Changing it will not turn café back into café.
A practical diagnostic sequence
Use this order when an import looks wrong:
- Open the source file in a plain-text editor if possible. Confirm that accented characters and symbols are correct there.
- Check whether the source is UTF-8. If the file was exported by an older system, it may use a regional encoding.
- Import a small copy of the file. Do not replace a working sheet until the result is verified.
- Confirm the separator. Look for commas, semicolons, tabs, or another delimiter between fields.
- Set the spreadsheet locale to match the data's conventions.
- Inspect dates and decimal values before formatting the whole sheet.
A byte-order mark, or BOM, is a marker sometimes placed at the beginning of a UTF-8 file. It can help software detect UTF-8, but poorly behaved importers may treat it as part of the first column name. If the first header has an invisible extra character, remove the BOM in the exporting system or a text editor and import again.
Normalize ambiguous values before analysis
Dates such as 03/04/2026 are unsafe when the source locale is unknown. Prefer an unambiguous source format such as 2026-04-03, or ask the data owner which convention applies.
For decimal values imported as text, first confirm the decimal and thousands marks. Replacing punctuation without that context can change 1.234 from one thousand two hundred thirty-four into one point two three four.
Leading zeros have a related problem. A value such as 00127 may be converted to the number 127. If it is a five-digit code, restore its display with:
=TEXT(A2, "00000")This changes the displayed result to 00127, but it does not prove that the original value was a code. Preserve a raw imported column when the source meaning matters.
Exercise
An imported CSV shows café, and dates such as 03/04/2026 are disputed. Which issue should you address first, and why?
Show answer
Address the character encoding first because the text is being decoded incorrectly. Then confirm the intended locale before interpreting the ambiguous date.