>>And the label displays "!Hi there" is that expected?

>Yes, that is correct in this case. The Hi There are Latin characters which 
>carry information in Unicode to indicate they should be displayed LTR. 
>However, the punctuation mark is a weak character (can be used in both >and 
>doesn't have this type of information) so the placement of that mark is 
>determined by the bidirectional algorithm. In this case, since you specified 
>rtl, it used that info to decide the punctuation mark should be >positioned at 
>the end of the word reading RTL.

One last comment on this: This is actually a place where things could use a bit 
of polish in general. In this case, since the weak character (!) was following 
a run (continuous grouping) of LTR characters, it would have been nice for the 
BiDi algorithm to note that fact and place the ! at the end of the 'Hi there'. 

In BiDi text you might get a group of characters written RTL, then a group 
written LTR (Imagine an Arabic language review of an English language film; the 
review would be in Arabic, but the title of the film would still be written LTR 
in English). When you have weak characters at these transition points it is 
often very difficult to determine the placement, so the BiDi algorithm will 
often fail upward to determine the direction. So, in other words, picking up 
the rtl you had set on the application as the overarching direction when it's 
not sure. This, however, should be more of a last resort thing and it should 
really try a bit harder first. This particular issue was determinable IMO. That 
said, these types of issues are fairly common in BiDi algorithms and so while I 
think it could be better, it's understandable.

So, when I said it's correct, it's probably better to say that it is the way it 
has always worked since the received the first RTL support. It could be better, 
but there are actually a lot of little issues like this in the algorithm being 
used that were deemed good enough years back. Whether they are still good 
enough likely depends on the availability of someone with the knowledge and 
time to get into this.

Mike



Reply via email to