Hi SanderDk,
Thank you for your reply.
You are right, but when I save the file on my local computer, open it in Notepad and select "Save as", then I can see that it is "UTF-8".
The file must be imported into "EG Lønservice" and the letters æ, ø and å are not correct after the import.
If I manually make a text file with ANSI encoding using Notepad, then it works fine.
Best regards,
Morten
I would expect what you do to work correctly. If it does not, I'd write to a tempfile, then download that tempfile. This way you can set the TEXTENCODING on the outstream.
Answers
According to MS Docs the Windows format is ANSI :
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-file-handling-and-text-encoding?wt.mc_id=DX-MVP-5003099#windows-format
Thank you for your reply.
You are right, but when I save the file on my local computer, open it in Notepad and select "Save as", then I can see that it is "UTF-8".
The file must be imported into "EG Lønservice" and the letters æ, ø and å are not correct after the import.
If I manually make a text file with ANSI encoding using Notepad, then it works fine.
Best regards,
Morten
I have the data in a Temp Blob and save it to a file like this:
TempBlob.CreateInStream(IStream, TEXTENCODING::Windows);
//TempBlob.CreateInStream(IStream, TEXTENCODING::UTF8);
//TempBlob.CreateInStream(IStream, TEXTENCODING::MSDos);
Filename := 'Test.txt';
DownloadFromStream(IStream, '', '', '', Filename);