25. August 2017 13:59
charVar := 8314; // entspricht dem hochgestellten +
A.INIT;
A.RESET;
IF A.FINDFIRST THEN BEGIN
CLEAR(bigtextVar);
bigtextVar.ADDTEXT(FORMAT(charVar));
MESSAGE(FORMAT(bigtextVar)); // es erscheint noch richtig
A.Description.CREATEOUTSTREAM(OutStr,TEXTENCODING::UTF16);
bigtextVar.WRITE(OutStr);
A.MODIFY;
CLEAR(bigtextVar);
A.CALCFIELDS(Description);
A.Description.CREATEINSTREAM(InStr, TEXTENCODING::UTF16);
bigtextVar.READ(InStr);
MESSAGE(FORMAT(bigtextVar)); // es erscheint falsch
END;
28. August 2017 09:47
Name DataType Subtype Length
StreamOut OutStream
StreamWriter DotNet System.IO.StreamWriter.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Encoding DotNet System.Text.Encoding.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
CLEAR(Langtext);
IF myText <> '' THEN BEGIN
Langtext.CREATEOUTSTREAM(StreamOut);
StreamWriter := StreamWriter.StreamWriter(StreamOut,Encoding.UTF8);
StreamWriter.Write(mytext);
StreamWriter.Flush;
StreamWriter.Close;
END;
Name DataType Subtype Length
myText Text
Stream InStream
StreamReader DotNet System.IO.StreamReader.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Encoding DotNet System.Text.Encoding.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
CALCFIELDS(Langtext);
IF NOT Langtext.HASVALUE THEN
EXIT('')
ELSE BEGIN
Langtext.CREATEINSTREAM(Stream);
StreamReader := StreamReader.StreamReader(Stream,Encoding.UTF8,true);
myText := StreamReader.ReadToEnd;
StreamReader.Close;
EXIT(myText)
END;
28. August 2017 11:13