0
I’m asking this question because for days I’m having a huge pain in the ass with this junk from Richedit, time he saves right time he saves a lot of ??????????????????????? at the base... I know it may be error in character conversion but the detail is that the problem is intermittent.
If this is the first time you record it correctly
If it’s editing it records a bunch of weird characters, like Chinese.
If I clear the base and insert the text again and save correctly.
Sometimes in editing it records correctly.
I would like to exchange everything for HTML but it is unviable, are years of recording everything in Richedit, because I need the formatted text.
The way I’m doing goes below:
...
fdm.RichStream := TStringStream.Create(fdm.zqrAux_Aet_TextoDiversas.AsAnsiString);
//fdm.zqrAux_Aet_TextoDiversas.SaveToStream(fdm.RichStream);
f_richedit := Tf_richedit.Create(nil);
fdm.RichStream.Position := 0;
f_richedit.RichEdit.Lines.LoadFromStream(fdm.RichStream);
TFuncoes.pJustRichEdit(f_richedit.RichEdit, False);
f_richedit.ShowModal;
if (fdm.Salvar) then
begin
fdm.zqrAux_Aet_Texto.Edit;
fdm.RichStream.Position := 0;
fdm.zqrAux_Aet_TextoDiversas.LoadFromStream(fdm.RichStream);//AsString := fdm.RichStream.DataString;
fdm.zqrAux_Aet_Texto.Post;
fdm.zConecta.Commit;
end;
FreeAndNil(fdm.RichStream); // .Free;
fdm.zqrAux_Aet_Texto.Close;
f_richedit := nil;
Note in some "commented" that I have tried saving in other ways, but the problem remains
The database is postgresql, but I think that’s not even the case, because it saves text there and this with UTF8 and everything as the costume asks
Someone knows a sure way to work with this Richedit?
I say safe because correct no longer know, rs
fdm.Salvar
is a method or just a boolean variable?fdm.RichStream
and not what is formatted inf_richedit.RichEdit
– Matheus Ribeiro
I believe you already solved your problem, but I went through the same problem. Firebird Database, had a Blob subtype field 1 segment size 5. . Solution: Switch to blob subtype 0 segment size 80; Options and field definitions Blob MEMO as blob subtype 1 segment size 5; FIGURE as blob subtype 0 segment size 50; TEXT as blob subtype 0 segment size 80; we use MEMO for small text, in an environment of 10MB of characters. we use FIGURE to store image-only images. we use TEXT for text editor files at
– Marcos