loulid39
loulid39

Reputation: 41

Excel not showing Euro symbol correctly in generated CSV file

I'm working in a web application and I need to generate CSV file. the CSV file contains prices in euro like 140 € but when I open the CSV file, Excel doesn't show the Euro symbol correctly 140 € .

I read data from Oracle database, store CSV file content in List<String> and write the result in HttpServletResponse response like

List<String> data = getCsvContent();
response.getOutPutStream().write(data.toString().getBytes("UTF-8")); 

I'm working in Windows 7, MS Office 2010 and I would like to know if there is any way to tell Excel to open this file in UTF-8 encoding? I tried to add BOM but there is no effect.

please help me to solve this problem, thanks in advance

Edit:

I'm using AJAX Call to download file, before donwloading file, i add BOM to the result. when i open the file by double click Excel open the CSV correctly in developpement environnement (local) but when i deploy the application in remote server, the euro symbol in the csv file is not written correctly, that's mean Excel can't show the symbol correctly.

any one can tell what can be the problem?

Upvotes: 3

Views: 7212

Answers (1)

toffler
toffler

Reputation: 1233

I had the same problem. You can import it the following way:

  1. Create a new Excel Sheet.
  2. Go to Data --> From Text, like shown in the image below (German Excel Version)

enter image description here

  1. Set File origin to Unicode (UTF-8) inside the Popup.
  2. Click next and set your separator according to your .csv file.. (most likely comma)
  3. Click next to review all of your columns. You can set specific data formats for each colmn (like date, text...)

Finish the wizard and it should be working.

Upvotes: 3

Related Questions