Inserting Zero Width Joiner control character ZWJ (#$200D)
-
- Posts: 4
- Joined: Fri Aug 17, 2007 5:17 pm
Inserting Zero Width Joiner control character ZWJ (#$200D)
Dear Sergey,
the Zero Width Joiner (ZWJ = #$200D = #8205) does not work.
As example,
if I enter this sequence
क + ् + #8205
then the result must be
क्
But it looks like the control character gets lost in the editor so the result is just this:
क्
What I do in the program is:
procedure InsertZWJ(View: TRichViewEdit);
var
wcZWJ: WideString;
begin
wcZWJ := 'क' + '्' + #8205;
View.InsertTextW(wcZWJ, False);
end;
Would you like to suggest a solution for this problem?
Thank you.
Wadim
the Zero Width Joiner (ZWJ = #$200D = #8205) does not work.
As example,
if I enter this sequence
क + ् + #8205
then the result must be
क्
But it looks like the control character gets lost in the editor so the result is just this:
क्
What I do in the program is:
procedure InsertZWJ(View: TRichViewEdit);
var
wcZWJ: WideString;
begin
wcZWJ := 'क' + '्' + #8205;
View.InsertTextW(wcZWJ, False);
end;
Would you like to suggest a solution for this problem?
Thank you.
Wadim
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 4
- Joined: Fri Aug 17, 2007 5:17 pm
Thank you. When do you plan to release the next update?Sergey Tkachenko wrote:Will be fixed in the next update.
You are right, it usually should be inserted between characters to prevent the building complex conjuncts like this oneSergey Tkachenko wrote:But should not it be inserted BETWEEN the characters to join?
क् + ष = क्ष
But using ZWJ we get another result
क् + ZWJ + ष = क्ष
It is very important for complex Unicode scripts like Indic Devanagari ...
There are also other special (control) characters which are very important too, as example ZWNJ (#8204, Zero Width Non-Joiner)
क् + ZWNJ + ष = क्ष
Wadim
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 4
- Joined: Fri Aug 17, 2007 5:17 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 4
- Joined: Fri Aug 17, 2007 5:17 pm
-
- Posts: 75
- Joined: Fri Jan 06, 2012 8:13 pm
-
- Posts: 75
- Joined: Fri Jan 06, 2012 8:13 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I made the following test: I copied the second post of rvuser1719 (the post containing examples using #$200D) and pasted it as a plain Unicode text in the ActionTest demo (a demo available on the web site, compiled using Delphi XE2 and the latest TRichView version).
The results look like expected: like they are displayed in a browser. I tried Arial and Times New Roman fonts.
If you have problems, please create a simple demo project and send it to me (richviewgmailcom).
The results look like expected: like they are displayed in a browser. I tried Arial and Times New Roman fonts.
If you have problems, please create a simple demo project and send it to me (richviewgmailcom).
-
- Posts: 75
- Joined: Fri Jan 06, 2012 8:13 pm
hi dear sergey.
i resolve it!
before loading rtf file, i replace \zwnj that deleted in richview with \-
and after loading in richview replace it with #$200F and problem fix...
i resolve it!
before loading rtf file, i replace \zwnj that deleted in richview with \-
and after loading in richview replace it with #$200F and problem fix...
Code: Select all
sRTF:=Tstringlist.Create;
sRTF.LoadFromFile('d:\sample\doc1.rtf');
//sRTF.Text:=Replace(sRTF.Text,'\zwnj',' ');
sRTF.Text:=Replace(sRTF.Text,'\zwnj','\-');
sRTF.SaveToFile('d:\sample\doc1_tmp.rtf');
Code: Select all
rv.BeginUpdate;
RVSetLinearCaretPos(rv,0);
ft := #173; rt:= #$200F;
while rv.SearchText(ft,[rvseoDown]) do
rv.InsertText(rt,False);
RVSetLinearCaretPos(rv,0);
rv.EndUpdate;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: