TempBlob.INIT; TempBlob.Blob.CREATEOUTSTREAM(OutStream); OutStream.WRITETEXT(SomeTextVariable); TempBlob.ReadAsText('', TEXTENCODING::UTF8))Where SomeTextVariable = 'xńx'. As you can assume 'ń' is making me some kind of trouble.
In procedure TempBlob.ReadAsText.Invalid data encountered in stream, unable to read text.
procedure MyReadAsText(var TempBlob) Content: Text begin TempBlob.Blob.CREATEINSTREAM(InStream); InStream.READTEXT(Content); // HERE I've ommited the TextEncoding parameter! WHILE NOT InStream.EOS DO BEGIN InStream.READTEXT(ContentLine); Content += ContentLine; END; end
Answers
https://docs.microsoft.com/en-us/dynamics-nav/text-encoding