Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Excel to CSV with UTF8 encoding

I have an Excel record that has some Spanish characters (tildes, and so forth) that I need to change over to a CSV document to use as an import document. Nonetheless, when I do Save As CSV it damages the "uncommon" Spanish characters that aren't ASCII characters. It likewise appears to do this with the left and right statements and long runs that have all the earmarks of being coming from the first client making the Excel document in Mac.

Since CSV is only a content document I'm certain it can deal with a UTF8 encoding, so I'm getting it is an Excel restriction, yet I'm searching for an approach to get from Excel to CSV and keep the non-ASCII characters unblemished.
by

3 Answers

ninja01
1. Save the Excel sheet as "Unicode Text (.txt)". The good news is that all the international characters are in UTF16 (note, not in UTF8). However, the new ".txt" file is TAB delimited, not comma delimited, and therefore is not a true CSV.

2. (optional) Unless you can use a TAB delimited file for import, use your favorite text editor and replace the TAB characters with commas ",".

3. Import your
.txt file in the target application. Make sure it can accept UTF16 format.

If UTF-16 has been properly implemented with support for non-BMP code points, that you can convert a UTF-16 file to UTF-8 without losing information. I leave it to you to find your favourite method of doing so.
RoliMishra
You can use iconv command under Unix (also available on Windows as libiconv).

After saving as CSV under Excel in the command line put:

iconv -f cp1250 -t utf-8 file-encoded-cp1250.csv > file-encoded-utf8.csv

(remember to replace cp1250 with your encoding).

Works fast and great for big files like postcodes database, which cannot be imported to GoogleDocs (400.000 cells limit).
kshitijrana14
A simple workaround is to use Google Spreadsheet. Paste (values only if you have complex formulas) or import the sheet then download CSV. I just tried a few characters and it works rather well.

NOTE: Google Sheets does have limitations when importing.

NOTE: Be careful of sensitive data with Google Sheets.

EDIT: Another alternative - basically they use VB macro or addins to force the save as UTF8. I have not tried any of these solutions but they sound reasonable.

Login / Signup to Answer the Question.