Bidirectional isolate 2026-11-05
A bidirectional isolate is a span treated as a directional unit by the Unicode Bidirectional Algorithm. Its internal text is resolved separately from the surrounding text; the isolate as a whole behaves neutrally in its surroundings. This limits directional interaction when inserting a span whose contents have their own writing direction.[ref]
Unicode directional controls can delimit the span: LRI (U+2066) chooses left-to-right isolation, RLI (U+2067) chooses right-to-left isolation, FSI (U+2068) infers direction from the first relevant strong character, and PDI (U+2069) terminates the isolate. Higher-level markup can express equivalent isolation without storing those explicit control characters.[ref]
An original record-layout example has three fields: a fixed prefix, a user-supplied name and a fixed suffix containing punctuation and an identifier. Treat the inserted name as one isolated span. The outer layout then works with that span as a unit, while its contents receive their own directional processing. A name containing both letters and digits still needs internal reordering; isolation does not prescribe a reversal of every character inside it.
For a reproducible plain-text notation, write the sequence as prefix RLI payload PDI suffix, with the uppercase labels standing for control code points rather than literal letters in the displayed text. This notation documents the boundary without hiding directional controls in the source example. An actual test should record the concrete payload, paragraph direction, Unicode version and line boundaries as well.
Nesting introduces another distinction: a first-strong isolate determines its direction from an eligible strong character outside nested isolates. A direction already enclosed in a nested span need not choose the enclosing span's direction. Naming the span boundary and the rule used to choose its direction makes this behavior explicit.[ref]
The Unicode Bidirectional Algorithm computes visual text order from logical text order. Unicode bidirectional classes and context determine bidirectional embedding levels: levels with an even integer value run left-to-right, and those with an odd integer value run right-to-left. Stored code points retain their order; text shaping is separate.[ref]
After levels and line boundaries are resolved, level-based reordering of bidirectional text descends from the largest level to the smallest level that is an odd integer. Each pass reverses maximal consecutive runs at or above its level.[ref]
Here is a small example with the resolved levels supplied. The labels each represent a distinct right-to-left text character, while represent left-to-right text characters. All rows below are written in physical left-to-right order. Start with
The level 2 pass changes the middle digits to . The level 1 pass then reverses the whole five-item middle run, producing
The digits have been reversed twice, preserving their original internal order. Reversing the entire stored sequence once would instead exchange and and leave the digits in the wrong order. This example demonstrates the reordering step, not how all Unicode bidirectional classes are resolved.
Figure 1.
Two level-based reversals preserve the internal order of the digits
. Original illustration with supplied bidirectional embedding levels. The boxes denote individual abstract text characters, not literal multi-character labels. Details.
A bidirectional isolate limits directional interaction between inserted text and its surroundings. Markup can express isolation without storing explicit formatting code points.[ref]
Mark Davis created the annex's initial version; later revisions extended it.[ref]
A Unicode directional control is a formatting code point that affects bidirectional processing without contributing an ordinary visible letter. Directional marks, embeddings, overrides and isolate delimiters provide different mechanisms within the Unicode Bidirectional Algorithm. They affect interpretation of the stored sequence rather than supplying new letter shapes.[ref]
Left-to-right and right-to-left marks, LRM (U+200E) and RLM (U+200F), behave as strong directional items while remaining invisible. A right-to-left isolate initiator, RLI (U+2067), instead starts a bounded bidirectional isolate; PDI (U+2069) terminates it. A mark and a span delimiter therefore carry different structural information.[ref]
An original counting example documents controls by their numerical values. The sequence U+2066 U+0061 U+0062 U+2069 contains LRI, the two Latin letters a and b, and PDI. It contains four code points and eight UTF-8 bytes: three for each delimiter and one for each Latin letter. Its ordinary visible letters are just a and b. Counting visible letters would therefore lose information about the represented sequence.
This notation intentionally shows the control values instead of placing hidden directional formatting characters in the source example. To reproduce an actual layout test, record its logical text order, paragraph direction, Unicode version and line boundaries, then compare the computed bidirectional embedding levels and visual text order.
A higher-level format can express equivalent directional structure through markup. The control-code-point representation and the markup representation need not have the same stored characters even when they request corresponding layout behavior. The specification defines those correspondences, while text shaping remains a further part of rendering.[ref]