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
Yishay1Yishay1 

Encoding an attachment as ANSI

Hi,

I need to encode an attachment in ANSI format.
I thought this will work:
Attachment att = new Attachment (
            ParentId = parentObjectId,
            Name = fileName,
            Body = Blob.valueOf(body),
            ContentType = 'text/plain; charset=ansi'
        );

But when I download the attachment it was still UTF-8.
Any ideas?
Thanks in advance,
Yishay
Yishay HaspelYishay Haspel
I'll really appreciate some comment from the SFDC development team, I can't find any documentation about this.
Thanks,
Yishay
carlostcarlost
This is a problem we are also having in our Org!
Can you please help?
Thank you!
Tony ColemanTony Coleman
The lack of ability to use ANSI encoding (i.e. remove special chars from UTF-8 string) is a problem here as well.