Board index » delphi » TRichEdit and its Font.Charset

TRichEdit and its Font.Charset

I am using TRichEdit and when entering arabic text then both Text and
Lines.Text property gives me ????s instead of the characters in arabic code
page.

I set the Font.CharSet to ARABIC_CHARSET.

When using any other control, like TMemo it is working fine, the
Memo1.Lines.Text contains the characters using the Arabic CodePage.

Can anybody tell me how to get the same characters from a TRichEdit instead
of the question marks?

Thanks

Chopin

 

Re:TRichEdit and its Font.Charset


I found a "low-level" solution:

uses RichEdit;

var GetTextEx: TGetTextEx; s: array[0..4095] of Char; i: Integer;

      GetTextEx.cb := 4096;
      GetTextEx.flags := GT_DEFAULT;
      GetTextEx.codepage := 1256;//ANSI Arabic codepage
      GetTextEx.lpDefaultChar := nil;
      GetTextEx.lpUsedDefChar := Pointer(false);
      i := SendMessage(RichEdit1.Handle, EM_GETTEXTEX, WParam(@GetTextEx),
LParam(@s[0]));

This is working. Isn't there a TRichEdit component function or property to
be able to do the same?

Thanks,

Chopin

Quote
"Karoly Horvath" <Horva...@compuserve.com> wrote in message

news:3e19c2fe@newsgroups.borland.com...
Quote
> I am using TRichEdit and when entering arabic text then both Text and
> Lines.Text property gives me ????s instead of the characters in arabic
code
> page.

> I set the Font.CharSet to ARABIC_CHARSET.

> When using any other control, like TMemo it is working fine, the
> Memo1.Lines.Text contains the characters using the Arabic CodePage.

> Can anybody tell me how to get the same characters from a TRichEdit
instead
> of the question marks?

> Thanks

> Chopin

Other Threads