Why my Editor didn't show the Hebrew letter?

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Why my Editor didn't show the Hebrew letter?

Post by alexandreq »

Hello

I copied and posted this page

http://www.sacred-texts.com/jud/tmm/tmm07.htm

in my dbrichview. There are some hebrew letter and it replaced with ???

Why? What should I do to have the hebrew letter in my dbrichview?

thanks
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which version of Delphi do you use?
Which browser do you copy from?
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

I Use Delphi 7 and I posted from Fire Fox Browse.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you do not use special procedures of RvHtmlImporter or RvHtmlViewImporter, text from FireFox is inserted as a plain text (as far as I know, it does not copy RTF to the Clipboard).

Now, two options are possible.
1) If RichViewEdit is configured to use Unicode, it will insert Unicode text from the Clipboard, so it can freely support multilingual text.

2) If RichViewEdit is not configured to use Unicode, it will insert non-Unicode text, and there are some rules to insert it correctly:
- the language of the copied text is determined at the moment of copying; the keyboard layout it the moment of copying must be Hebrew;
- the text will be inserted as a Hebrew text, but is not necessary to be formatted with HEBREW_CHARSET, so you may see wrong characters in place of Hebrew (TRichViewEdit can switch the charset of the inserted text, of you include rvfoAutoSwitchLang in EditorOptions; however, the charset is switched only if you change the keyboard layout when the caret is in the editor).

As you can see, using Unicode is much simpler. See http://www.trichview.com/forums/viewtop ... t=70#11569 for the instructions.

PS: Hebrew is supported in TRichViewEdit only if you change its BiDiMode property = rvbdLeftToRight or rvbdRightToLeft.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hello Sergey,

I Tried to paste the text from
http://www.sacred-texts.com/jud/tmm/tmm07.htm

In your example RichView Action and the letters in hebrew didn't appear, they were changed to ????

Could you tell me what I need to change so that could work in your example?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1) Add the following procedures in the main Form:

Code: Select all

procedure TForm3.DoOnNew(Sender: TObject);
begin
  ConvertToUnicode(RichViewEdit1);
  RichViewEdit1.BiDiMode := rvbdLeftToRight;
end;

procedure TForm3.DoOnOpenFile(Sender: TObject; Editor: TCustomRichViewEdit;
  const FileName: String; FileFormat: TrvFileOpenFilter;
  CustomFilterIndex: Integer);
begin
  ConvertToUnicode(RichViewEdit1);
  RichViewEdit1.BiDiMode := rvbdLeftToRight;
end;
2) At the beginning of procedure TForm3.FormCreate, add:

Code: Select all

  rvActionsResource.rvActionNew1.OnNew := DoOnNew;
  rvActionsResource.rvActionOpen1.OnNew := DoOnNew;
  rvActionsResource.rvActionOpen1.OnOpenFile := DoOnOpenFile;
  RichViewEdit1.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;
Now, all text in this demo will be Unicode, and Hebrew text will be pasted without problems.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hello Sergey,

I did what you told me to do, I did with action Test example that comes with your component and it didn't work.

I zipped the fold of ActionTestTabs example, so that you can take a look at it.

Please, download it from here

http://www.infosoftlanguages.com/arquiv ... stTabs.zip

What is wrong once you gave me the steps and all should work?

thanks
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Your exe-file works ok for me.
Do you see '?' or other characters in place of Hebrew?
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

I see ??, not hebrew letters. Why? Something that should I do in my computer? Strange that the exe worked with you and not with me.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Correction to your code:

Code: Select all

procedure TForm3.DoOnNew(Sender: TObject);
begin
  ConvertToUnicode(ActiveEditor.RichViewEdit);
  ConvertToUnicode(ActiveEditor.RVHeader);
  ConvertToUnicode(ActiveEditor.RVFooter);
  ActiveEditor.BiDiMode := rvbdLeftToRight;
end;

procedure TForm3.DoOnOpenFile(Sender: TObject; Editor: TCustomRichViewEdit;
  const FileName: String; FileFormat: TrvFileOpenFilter;
  CustomFilterIndex: Integer);
begin
  ConvertToUnicode(ActiveEditor.RichViewEdit);
  ConvertToUnicode(ActiveEditor.RVHeader);
  ConvertToUnicode(ActiveEditor.RVFooter);
  ActiveEditor.BiDiMode := rvbdLeftToRight;
end;
The main change: using ActiveEditor instead of SRichViewEdit1. SRichViewEdit1 is the first editor placed at design time. It allows accessing only the first tab, while it is not closed.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Sergey, now it worked fine.

thanks very much.

Now I will try in my code.
Post Reply