Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What charset does Microsoft Excel use when saving files?

I have a Java app which reads CSV files which have been created in Excel (e.g. 2007). Does anyone know what charset MS Excel uses to save these files in?

I would have guessed either:

  • windows-1255 (Cp1255)
  • ISO-8859-1
  • UTF8

but I am unable to decode extended chars (e.g. french accentuated letters) using either of these charset types.

like image 489
Joel Avatar asked Feb 03 '09 19:02

Joel


People also ask

Is Excel CSV UTF-8?

UTF-8 Encoding in Microsoft Excel (Windows) Click File in the top-left corner of your screen. Click the drop-down menu next to File format. Select CSV UTF-8 (Comma delimited) (. csv) from the drop-down menu.

What encoding does Excel save CSV in?

In Excel 2016 and later versions, you can save a file in the CSV format with UTF-8 encoding directly: In the target worksheet, click File > Save As or press the F12 key. In the Save As dialog box, select CSV UTF-8 (comma delimited) (*. csv) from the Save as type drop down.

How do I save an Excel file with UTF-8 encoding?

Click File > Save As. You will see the Save dialog box. Via the File Format dropdown menu, select the CSV UTF-8 option. Click Save.

What format are Excel files saved in?

In Microsoft Excel, workbooks are saved as Excel Workbooks (. xlsx) by default. You can change the default file format to any other file format that is supported in Excel. For example, if you frequently create macros in a workbook, you may want to automatically save a new workbook as an Excel Macro-Enabled Workbook (.


2 Answers

From memory, Excel uses the machine-specific ANSI encoding. So this would be Windows-1252 for a EN-US installation, 1251 for Russian, etc.

like image 185
devstuff Avatar answered Oct 08 '22 16:10

devstuff


CSV files could be in any format, depending on what encoding option was specified during the export from Excel: (Save Dialog, Tools Button, Web Options Item, Encoding Tab)

UPDATE: Excel (including Office 2013) doesn't actually respect the web options selected in the "save as..." dialog, so this is a bug of some sort. I just use OpenOffice Calc now to open my XLSX files and export them as CSV files (edit filter settings, choose UTF-8 encoding).

like image 37
Triynko Avatar answered Oct 08 '22 16:10

Triynko