web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

how to convert utf8 bom to utf8 format in business central?

(0) ShareShare
ReportReport
Posted on by 13

Hi,

I am trying to convert UTF-8 BOM to UTF-8 format in Business Central using XMLport object in AL but am unable to do so. I have already used the TextEncoding property in XMLport, but it takes the UTF-8 BOM format by default. Any suggestions for getting from UTF-8 BOM to UTF-8 format?

I am running my XMLport in the code below.

local procedure Export_File()

var

TempBlob: Codeunit "Temp Blob";

CustomBalance: XmlPort Balance;

OutStreamStr: OutStream;

begin

TempBlob.CreateOutStream(OutStreamStr);

CustomBalance.SetDestination(OutStreamStr);

CustomBalance.InitializeRequest(0D, EndDate);

if CustomBalance.Export() then begin

ExportBlobList.Add(TempBlob);

ExportFileNames.Add(CustomBalance.Filename());

end;

end;

I have the same question (0)
  • Ramiz Profile Picture
    597 on at
    Hi,

    Try adding the TextEncoding in CreateOutStream.
     
    TempBlob.CreateOutStream(OutStreamStr, TextEncoding::UTF8);
     
  • Suggested answer
    Gani.A Profile Picture
    13 on at
    Hi Ramiz,
     
    I also tried using CreateOutStream(), but still the same output.
     
    TempBlob.CreateOutStream(OutStreamStr, TextEncoding::UTF8);
  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,419 User Group Leader on at
    Hi,
     
    I am confused are you saying BLOB instead of BOM?
     
  • Suggested answer
    Gani.A Profile Picture
    13 on at
     
    It is UTF-8-BOM, the encoding of the file is UTF-8 BOM although the TextEncoding property is set to UTF-8. I also tried
    CurrXMLport.TextEncoding(TextEncoding::UTF-8) and this also failed to get UTF-8.
     
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,204 Super User 2026 Season 1 on at

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,894 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,086 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 626 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans