function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
andream.ax1123andream.ax1123 

Encoding for apex generated csv file

Hi,

I'm exporting data as csv using a Document object. I found a problem when I try to import the csv file into Microsoft Excel (Office 2007). The csv file is exported in utf-8 and excel expects an ansi file.

I've found a workaround importing the file instead of just opening it. But I want to know if there is any other easier way for the end-users of opening the file. Or another way of generating the file with ansi encoding.

 

thanks in advance,

_Prasu__Prasu_

What contenttype your are setting for the generation?

andream.ax1123andream.ax1123

I'm using :  text/plain

_Prasu__Prasu_

try setting content type "application/vnd.ms-excel"

andream.ax1123andream.ax1123

I tried with that encoding option too, but it didn't work.  Anyway thanks for the quick reply .