I want to generate a csv attachement and force ANSI encoding how can i do that? Code to create my attachement:
string rows = 'column1;column2;column3'+'\n'+'a;b;c'
Attachment attachment = new Attachment();
attachment.Body = Blob.valueOf(rows);
attachment.Name = 'file.csv';
attachment.ParentId = recordId;
insert attachment;
I've tried charset=ANSI it didn't generate a csv.