I am trying to export a Csv file from a Visualforce page.
I have the following:
<apex:page controller="CaseCSVController" contentType="text/csv#File.csv" showheader="false" >
This way I export it as UTF-8 (Without BOM), thus the file opens "Broken" on Excel. Also if I edit the file and save it, the Excel changes its format to ANSI, which Salesforce doesn't accept.
If I change my code to any of those:
<apex:page controller="CaseCSVController" contentType="text/csv, charset=UTF-8#File.csv" showheader="false" >
OR
<apex:page controller="CaseCSVController" contentType="text/csv; charset=UTF-8;#File.csv" showheader="false" >
OR
<apex:page controller="CaseCSVController" contentType="application/vnd.ms-excel#File.csv; charset=UTF-8" showheader="false" >
It opens correctly on Excel, but with ANSI format and again, Salesforce doesn't accept.
I must EXPORT an CSV file WITH UTF-8 characters and after the user edit some lines, IMPORT with the changes.
Mostly important: I want to export on the right format and not tell to the users convert by themselves.