Search code examples
unicodebidi

Unicode BIDI (UBA): Test = RLE ES LRE -> Difficulties following the specs


This is quite a specific bidi algorithm question, I am hoping someone out there can help my understanding of the algorithm.

I am having a hard time with the the following test from the BidiTest-10.0.0d5.txt

@Levels x, 1, x
@Reorder 1
RLE ES LRE; 2

http://unicode.org/cldr/utility/bidi.jsp?a=%E2%80%AB%2B%E2%80%AA&p=LTR

The unicode tool above applies rule W6 on the RLE character and converting it to an ON.

Why is that? Rule W6 states:

"Otherwise, separators and terminators change to Other Neutral".

obviously I am missing some detail, I just can't seem find it.

Any hint appreciated, thank you :)


Solution

  • I think this is what is happening. The implementation may be designed to retain, rather than remove, boundary-neutral and explicit formatting characters (see the implementation notes). Thus rule X9 adds the action "do not remove any characters, but turn all RLE, LRE, RLO, LRO, and PDF characters into BN" and thus turns the LRE into BN, then rule W6 adds the action "change all BN types adjacent to ET, ES, or CS to ON as well" and so changes the BN that was an LRE to ON.