Saving Unicode Characters to RTF in OnSaveComponentToFile
Posted: Wed Jul 15, 2015 9:03 am
I have a couple of controls (TEdit for example) inserted into a RichView Document and want to produce RTF containing text entered in those controls like this:
Unfortunately if those controls contain special Unicode characters like ☒ (U+2612) they do not get converted correctly.
What is the best way of saving components with Unicode characters to RTF to preserve all possible characters?
Code: Select all
procedure TRichForm.RichMemoSaveComponentToFile(Sender: TCustomRichView;
Path: string; SaveMe: TPersistent; SaveFormat: TRVSaveFormat;
var OutStr: string);
begin
if SaveMe is TCustomEdit then
OutStr := TCustomEdit(SaveMe).Text;
end;
What is the best way of saving components with Unicode characters to RTF to preserve all possible characters?