SaveHTMLToStream and SaveTextToStream
Posted: Fri Nov 29, 2024 11:51 am
Hi Sergey,
I am saving the RVE content to my database file as HTML, and that is working fine.
However, I have another component on the form that displays a sub-set of the 'plain text' from the RVE. What is the correct way to extract the plain text? I tried creating a TextStream and use SaveTextToStream, however it occasionally throws exceptions with the error "Exception class EEncodingError with message 'No mapping for the Unicode character exists in the target multi-byte code page'"
var
HTMLStream,TextStream:TStringStream;
HTMLStream:=TStringStream.Create('', TEncoding.UTF8);
TextStream:=TStringStream.Create('', TEncoding.UTF8);
rve.SaveHTMLToStream(HTMLStream);
rve.SaveTextToStream('',TextStream,80,false,true); //this line generates exception on some RVE content
myComponent.text := TextStream.DataString.
Thanks
I am saving the RVE content to my database file as HTML, and that is working fine.
However, I have another component on the form that displays a sub-set of the 'plain text' from the RVE. What is the correct way to extract the plain text? I tried creating a TextStream and use SaveTextToStream, however it occasionally throws exceptions with the error "Exception class EEncodingError with message 'No mapping for the Unicode character exists in the target multi-byte code page'"
var
HTMLStream,TextStream:TStringStream;
HTMLStream:=TStringStream.Create('', TEncoding.UTF8);
TextStream:=TStringStream.Create('', TEncoding.UTF8);
rve.SaveHTMLToStream(HTMLStream);
rve.SaveTextToStream('',TextStream,80,false,true); //this line generates exception on some RVE content
myComponent.text := TextStream.DataString.
Thanks