DBRichViewEdit doesn't display correctly BLOB-field
Posted: Sat Aug 01, 2020 3:31 pm
Hello,
I'm working with Delphi 10.3 and the TRichview controls (18.3). In my current project I encountered a strange problem with TDBRichView und BLOB-Fields.
I have an TRichViewEdit control and need to store the formatted RTF-text to a BLOB-field (Firebird, subtype "text", character set UTF8) via stream (TMemoryStream). For saving the RTF to a stream I use "rve.SaveRTFToStream(bs,False)", for saving the stream to a BLOB-field I use "TBlobField(ds.fieldbyname(s_field)).LoadFromStream(bs)". When I read the content of the BLOB-field via stream and load it into a TRichViewEdit, everything works fine so far. The RTF-text is displayed correctly (1). When I load the stream to TMemo I can see the plain RTF-text (2). It's also okay. But when I bind a TDBRichViewEdit to the datafield the text contains stange characters (chinese, I suppose), and the original RTF-text will not be displayed (3). Because of the architecture of my application I must use streams to store the RTF-text, but sometimes I must use databound TDBRichViewEdit to display it. I have no clue how to handle this problem.
Thank you very much in advance
Norbert Richter
I'm working with Delphi 10.3 and the TRichview controls (18.3). In my current project I encountered a strange problem with TDBRichView und BLOB-Fields.
I have an TRichViewEdit control and need to store the formatted RTF-text to a BLOB-field (Firebird, subtype "text", character set UTF8) via stream (TMemoryStream). For saving the RTF to a stream I use "rve.SaveRTFToStream(bs,False)", for saving the stream to a BLOB-field I use "TBlobField(ds.fieldbyname(s_field)).LoadFromStream(bs)". When I read the content of the BLOB-field via stream and load it into a TRichViewEdit, everything works fine so far. The RTF-text is displayed correctly (1). When I load the stream to TMemo I can see the plain RTF-text (2). It's also okay. But when I bind a TDBRichViewEdit to the datafield the text contains stange characters (chinese, I suppose), and the original RTF-text will not be displayed (3). Because of the architecture of my application I must use streams to store the RTF-text, but sometimes I must use databound TDBRichViewEdit to display it. I have no clue how to handle this problem.
Thank you very much in advance
Norbert Richter