You need to sign in to do that
Don't have an account?

Visualforce CSV file export encoding issue
Hi
Issue is that certain symbols/letters appear broken on the CSV file that has been exported, as by default the encoding is ISO-8859-1.
However forcing it to export in UTF-8 seems to have zero effect - meaning the exported file will still have broken symbols, even though the symbols/letters are displayed correctly in SF itself.
The export function VS page code piece is like this :
Tried the solutions offered in ..
https://developer.salesforce.com/forums/?id=906F0000000962nIAA
http://salesforce.stackexchange.com/questions/16157/attachment-utf-8-character-set
http://salesforce.stackexchange.com/questions/18546/unable-to-display-utf-8-character-in-a-csv-file-generated-from-apex-code
Issue is that certain symbols/letters appear broken on the CSV file that has been exported, as by default the encoding is ISO-8859-1.
However forcing it to export in UTF-8 seems to have zero effect - meaning the exported file will still have broken symbols, even though the symbols/letters are displayed correctly in SF itself.
The export function VS page code piece is like this :
<apex:page controller="TestPage" cache="true" contentType="text/csv#filename.csv; charset=UTF-8">
Tried the solutions offered in ..
https://developer.salesforce.com/forums/?id=906F0000000962nIAA
http://salesforce.stackexchange.com/questions/16157/attachment-utf-8-character-set
http://salesforce.stackexchange.com/questions/18546/unable-to-display-utf-8-character-in-a-csv-file-generated-from-apex-code
Can you confirm that you tried the VF below (as suggested in the first article) ?
<apex:page controller="TestPageController" cache="true" contentType="text/csv#filename.csv" showheader="false">
Or, you may be able to use Notepad++ to convert the encoding?
Thanks,
Richard.
All Answers
Can you confirm that you tried the VF below (as suggested in the first article) ?
<apex:page controller="TestPageController" cache="true" contentType="text/csv#filename.csv" showheader="false">
Or, you may be able to use Notepad++ to convert the encoding?
Thanks,
Richard.
Yes, by adding that code piece the encoding issue remains and the header code is actually displayed in the exported list. Attached image.
As for the conversion - while that works even with regular Notepad, it isn't a practise we can use, due to the amount of time it would go for this. We'll need to force the UTF-8 encoding for the original file.
Thanks