Unicode bidirectional control characters — reference fixture ============================================================ Every control listed below appears LITERALLY in this file, between the << >> guards, so a parser, renderer or normalisation routine can be tested against real bytes rather than escapes. Guards are ASCII and are not part of the character. Two characters are deliberately ABSENT and are named only: U+202D LEFT-TO-RIGHT OVERRIDE and U+202E RIGHT-TO-LEFT OVERRIDE. Unbalanced overrides are the "Trojan Source" vector, in which source code renders in an order that does not match how a compiler reads it. A bidi rendering fixture does not need to ship one. IMPLICIT MARKS — zero width, strong direction, no scope ------------------------------------------------------- U+200E LEFT-TO-RIGHT MARK (LRM) <<‎>> UTF-8 E2 80 8E. Acts as an invisible strong LTR character. Use it to pin neutral characters (punctuation, digits, spaces) to the LTR run beside them. U+200F RIGHT-TO-LEFT MARK (RLM) <<‏>> UTF-8 E2 80 8F. The RTL twin of LRM. CLDR embeds RLM inside several Arabic and Hebrew date and currency patterns, which is why an "identical looking" pattern string can fail a byte comparison. U+061C ARABIC LETTER MARK (ALM) <<؜>> UTF-8 D8 9C. Like RLM but classed as Arabic Letter, so it also drives the resolution of adjacent European and Arabic-Indic digits. Preferred over RLM around numbers in Arabic. ISOLATES — the modern, nestable, self-terminating mechanism (Unicode 6.3+) -------------------------------------------------------------------------- U+2066 LEFT-TO-RIGHT ISOLATE (LRI) <<⁦>> U+2067 RIGHT-TO-LEFT ISOLATE (RLI) <<⁧>> U+2068 FIRST STRONG ISOLATE (FSI) <<⁨>> U+2069 POP DIRECTIONAL ISOLATE (PDI) <<⁩>> An isolate makes its contents a single neutral unit as far as the surrounding text is concerned, so the inserted run can neither reorder the text around it nor be reordered by it. FSI picks the direction from the first strong character INSIDE the isolate, which is what you want for user-supplied content whose language you do not know at build time. Balanced example — an Arabic sentence quoting an LTR product name: ‏المنتج ⁨Novus File Manager⁩ جاهز. EMBEDDINGS — the legacy mechanism, deprecated in favour of isolates ------------------------------------------------------------------- U+202A LEFT-TO-RIGHT EMBEDDING (LRE) <<‪>> U+202B RIGHT-TO-LEFT EMBEDDING (RLE) <<‫>> U+202C POP DIRECTIONAL FORMATTING (PDF) <<‬>> Balanced example (LRE ... PDF): ‪report-2026.pdf‬ Embeddings do NOT isolate: neutrals on either side still interact across the boundary, which is the bug isolates were introduced to fix. An unterminated embedding leaks to the end of the paragraph. U+202D LEFT-TO-RIGHT OVERRIDE (LRO) — named only, not present in this file U+202E RIGHT-TO-LEFT OVERRIDE (RLO) — named only, not present in this file WHAT TO ASSERT -------------- 1. All eight present controls survive a read/write round trip byte for byte. 2. A stripping routine removes exactly these code points and nothing else. 3. Every << >> guard block holds exactly ONE control character — those are specimens, deliberately unpaired, and a balance checker must be told to skip them. 4. On each line labelled "example", isolate initiators (LRI/RLI/FSI) balance against PDI, and embedding initiators (LRE/RLE) balance against PDF. 5. The file contains no U+202D and no U+202E anywhere.