Re: [i18n-discuss] Use of ZWJ

A few tests do produce some surprising results on both Firefox and 
Chrome.  Take a bidi mix of characters like the following:

U+0061 U+0061 LATIN SMALL LETTER A
U+0020 U+0020 SPACE
U+0647 U+0647 ARABIC LETTER HEH
U+200D U+200D ZERO WIDTH JOINER
U+0020 U+0020 SPACE
U+0062 U+0062 LATIN SMALL LETTER B
U+0020 U+0020 SPACE
U+200D U+200D ZERO WIDTH JOINER
U+0647 U+0647 ARABIC LETTER HEH
U+200D U+200D ZERO WIDTH JOINER
U+0020 U+0020 SPACE
U+0063 U+0063 LATIN SMALL LETTER C
U+0020 U+0020 SPACE
U+200D U+200D ZERO WIDTH JOINER
U+0647 U+0647 ARABIC LETTER HEH

Displayed as HTML in a LTR context it looks like:

![screen shot 2016-11-22 at 14 16 
00](https://cloud.githubusercontent.com/assets/4839211/20527156/2dedf398-b0bf-11e6-8c11-176b3201d815.png)

and in a RTL context like:

![screen shot 2016-11-22 at 14 20 
17](https://cloud.githubusercontent.com/assets/4839211/20527170/3a39fffc-b0bf-11e6-95a9-60b647a96143.png)

In a textarea, in a LTR context it looks like:

![screen shot 2016-11-22 at 14 20 
31](https://cloud.githubusercontent.com/assets/4839211/20527189/478188d8-b0bf-11e6-855d-42a6534669cb.png)

and only in a textarea with RTL context does it look like you might 
expect, ie. 

![screen shot 2016-11-22 at 14 21 
43](https://cloud.githubusercontent.com/assets/4839211/20527202/57f6e5aa-b0bf-11e6-986a-2a50793a4a6b.png)

I wonder whether it's something to do with the browser trying to 
determine the directionality first, then packaging up the runs of 
characters in such a way that the ZWJ becomes isolated from the arabic
 character it is adjacent to.

-- 
GitHub Notification of comment by r12a
Please view or discuss this issue at 
https://github.com/w3c/i18n-discuss/issues/2#issuecomment-262253816 
using your GitHub account

Received on Tuesday, 22 November 2016 14:26:03 UTC