Page 1 of 1

Why my Editor didn't show the Hebrew letter?

Posted: Thu Aug 23, 2012 11:10 am
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

Posted: Thu Aug 23, 2012 11:33 am
by Sergey Tkachenko
Which version of Delphi do you use?
Which browser do you copy from?

Posted: Thu Aug 23, 2012 1:15 pm
by alexandreq
I Use Delphi 7 and I posted from Fire Fox Browse.

Posted: Fri Aug 24, 2012 10:19 am
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.

Posted: Fri Aug 24, 2012 6:28 pm
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?

Posted: Sat Aug 25, 2012 5:39 pm
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.

Posted: Mon Aug 27, 2012 11:12 am
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

Posted: Mon Aug 27, 2012 2:39 pm
by Sergey Tkachenko
Your exe-file works ok for me.
Do you see '?' or other characters in place of Hebrew?

Posted: Mon Aug 27, 2012 3:51 pm
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.

Posted: Mon Aug 27, 2012 5:32 pm
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.

Posted: Mon Aug 27, 2012 6:36 pm
by alexandreq
Sergey, now it worked fine.

thanks very much.

Now I will try in my code.