Excel to CSV with UTF8 encoding

2018-12-31 09:02发布

I have an Excel file that has some Spanish characters (tildes, etc.) that I need to convert to a CSV file to use as an import file. However, when I do Save As CSV it mangles the "special" Spanish characters that aren't ASCII characters. It also seems to do this with the left and right quotes and long dashes that appear to be coming from the original user creating the Excel file in Mac.

Since CSV is just a text file I'm sure it can handle a UTF8 encoding, so I'm guessing it is an Excel limitation, but I'm looking for a way to get from Excel to CSV and keep the non-ASCII characters intact.

30条回答
旧时光的记忆
2楼-- · 2018-12-31 09:05

"nevets1219" is right about Google docs, however if you simply "import" the file it often does not convert it to UTF-8.

But if you import the CSV into an existing Google spreadsheet it does convert to UTF-8.

Here's a recipe:

  • On the main Docs (or Drive) screen click the "Create" button and choose "Spreadsheet"
  • From the "File" menu choose "Import"
  • Click "Choose File"
  • Choose "Replace spreadsheet"
  • Choose whichever character you are using as a Separator
  • Click "Import"
  • From the "File" menu choose "Download as" -> CSV (current sheet)

The resulting file will be in UTF-8

查看更多
谁念西风独自凉
3楼-- · 2018-12-31 09:05

I have the same problem and come across this add in , and it works perfectly fine in excel 2013 beside excel 2007 and 2010 which it is mention for.

查看更多
深知你不懂我心
4楼-- · 2018-12-31 09:09

I have also came across the same problem but there is an easy solution for this.

  1. Open your xlsx file in Excel 2016 or higher.
  2. In "Save As" choose this option: "(CSV UTF-8(Comma Delimited)*.csv)"

It works perfectly and a csv file is generated which can be imported in any software. I imported this csv file in my SQLITE database and it works perfectly with all unicode characters intact.

查看更多
无色无味的生活
5楼-- · 2018-12-31 09:09

Using Notepad++

This will fix the corrupted CSV file saved by Excel and re-save it in the proper encoding.

  • Export CSV from Excel
  • Load into Notepad++
  • Fix encoding
  • Save

Excel saves in CP-1252 / Windows-1252. Open the CSV file in Notepad++. Select

Encoding > Character Sets > Western European > Windows-1252

Then

Encoding > Convert to UTF-8
File > Save

First tell Notepad++ the encoding, then convert. Some of these other answers are converting without setting the proper encoding first, mangling the file even more. They would turn what should be into . If your character does not fit into CP-1252 then it was already lost when it was saved as CSV. Use another answer for that.

查看更多
忆尘夕之涩
6楼-- · 2018-12-31 09:09

open .csv fine with notepad++. if you see your encoding is good (you see all characters as they should be) press encoding , then convert to ANSI else - find out what is your current encoding

查看更多
永恒的永恒
7楼-- · 2018-12-31 09:09

another solution is to open the file by winword and save it as txt and then reopen it by excel and it will work ISA

查看更多
登录 后发表回答