01.11.2014 Views

A Proposal for Bidi Isolates in Unicode

A Proposal for Bidi Isolates in Unicode

A Proposal for Bidi Isolates in Unicode

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

All explicit embedd<strong>in</strong>g levels are determ<strong>in</strong>ed from the embedd<strong>in</strong>g, override, and isolate codes, by<br />

apply<strong>in</strong>g the explicit level rules X1 through X10. These rules are applied as part of the same<br />

logical pass over the <strong>in</strong>put. The follow<strong>in</strong>g variables are used dur<strong>in</strong>g this pass:<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

The current embedd<strong>in</strong>g level.<br />

The directional override status.<br />

The directional isolate status.<br />

A directional status stack where each entry consists of an embedd<strong>in</strong>g level, a directional<br />

override status, and an directional isolate status. The stack height is never over 60.<br />

A counter called the valid isolate count.<br />

A counter called the <strong>in</strong>valid isolate count.<br />

A counter called the <strong>in</strong>valid embedd<strong>in</strong>g count.<br />

As each character is processed, these variables are adjusted and the character’s explicit<br />

embedd<strong>in</strong>g level is set as def<strong>in</strong>ed by rules X1 through X9, given the variables’ current values and<br />

the bidirectional type of the character.<br />

Modify rule X1 by add<strong>in</strong>g the follow<strong>in</strong>g after “Set the directional override status to neutral.”:<br />

Set the directional isolate status to false. Set the stack to empty. Set the valid isolate count to<br />

zero. Set the <strong>in</strong>valid isolate count to zero. Set the <strong>in</strong>valid embedd<strong>in</strong>g count to zero.<br />

Modify rules X2 through X5 as follows:<br />

● Replace “If this new level would be valid” with “If this new level would be valid and the<br />

<strong>in</strong>valid isolate count and <strong>in</strong>valid embedd<strong>in</strong>g count are both zero”.<br />

● Replace “Remember (push) the current embedd<strong>in</strong>g level and override status” with “Push<br />

the current embedd<strong>in</strong>g level, override status, and isolate status on the directional status<br />

stack.”<br />

● Replace “Reset the current level to this new level” with “Reset the current level to the<br />

new level, reset the isolate status to false”.<br />

● Replace “If the new level would not be valid, then this code is <strong>in</strong>valid. Do not change the<br />

current level or override status” with “Otherwise, this RLE/LRE/RLO/LRO is <strong>in</strong>valid. Do<br />

not change the current level, override status, or isolate status. If the <strong>in</strong>valid isolate count<br />

is zero, <strong>in</strong>crement the <strong>in</strong>valid embedd<strong>in</strong>g count by one.”<br />

● Replace “...59, 60 → 61; above 60, no change (do not change levels with RLE/RLO if the<br />

new level would be <strong>in</strong>valid)” with “...; 60 → 61 when the <strong>in</strong>valid counts are both zero, but<br />

no change <strong>in</strong> the current embedd<strong>in</strong>g level otherwise. Above 60, no change.”<br />

● Replace “...58, 59 → 60; above 59, no change (do not change levels with LRE/LRO if the<br />

new level would be <strong>in</strong>valid)” with “...; 59 → 60 when the <strong>in</strong>valid counts are both zero, but<br />

no change <strong>in</strong> the current embedd<strong>in</strong>g level otherwise. Above 59, no change.”<br />

After rule X5, start a new subsection:<br />

<strong>Isolates</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!