NAV 2016 TextEncoding problem

dreezdreez Member Posts: 72
edited 2021-07-28 in NAV Three Tier
Hello,

I have a problem with TextEncoding. In general, what I am doing is:
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.
Sometimes (but not always!!!) I am running into an error:
Invalid data encountered in stream, unable to read text.
In procedure TempBlob.ReadAsText.
I've made the workaround, which is:
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

And this works (for my specific case). But I am worried what happens when you ommit this parameter?
What is the default TextEncoding for NAV, while creating InStream?

Answers

Sign In or Register to comment.