Why my Editor didn't show the Hebrew letter?
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
Why my Editor didn't show the Hebrew letter?
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
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
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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.
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.
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
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?
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?
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
1) Add the following procedures in the main Form:
2) At the beginning of procedure TForm3.FormCreate, add:
Now, all text in this demo will be Unicode, and Hebrew text will be pasted without problems.
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;
Code: Select all
rvActionsResource.rvActionNew1.OnNew := DoOnNew;
rvActionsResource.rvActionOpen1.OnNew := DoOnNew;
rvActionsResource.rvActionOpen1.OnOpenFile := DoOnOpenFile;
RichViewEdit1.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
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
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
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Correction to your code:
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.
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;
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm