I was exporting a csv file using outstream in Business Central with textencoding::UTF-08. Now I want textencoding::UTF-08-SIG or textencoding::UTF-08-BOM but I don't know how to do that. Can anyone please help?
BC doesn’t have UTF8-BOM, so you just write the BOM bytes yourself before writing the CSV:
// Write UTF-8 BOM manually
var bom: array[3] of Byte;
bom[1] := 239; // EF
bom[2] := 187; // BB
bom[3] := 191; // BF
OutStr.Write(bom);
// Then write your text normally (UTF8)
OutStr.WriteText(MyCsvText);
That produces UTF-8 with BOM (UTF-8-SIG).
Regards,
Oussama Sabbouh
1 people found this reply helpful.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.