Reputation: 41
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
Reputation: 1233
I had the same problem. You can import it the following way:
.csv
file.. (most likely comma)Finish the wizard and it should be working.
Upvotes: 3