Random Unicode Bidirectional Control Character Generator
Choose one Unicode bidirectional formatting control from ALM, LRM/RLM, embedding, override, pop, or isolate controls using injected randomness.
Description
Select one of twelve stored Unicode bidirectional formatting controls, returned as an escaped-identifiable string.
Bidirectional text uses logical character order and a separate visual display order. Unicode direction marks, embeddings, overrides, and isolates influence that layout without behaving like visible letters. Their effect depends on surrounding text and the renderer’s bidirectional algorithm.1
This generator selects one stored control and returns it as value. The repertoire contains ALM, LRM, RLM, LRE, RLE, PDF, LRO, RLO, LRI, RLI, FSI, and PDI. A result can look blank, so inspect its code point or JSON escape when using it in a test fixture.
When to use Random Unicode Bidirectional Control Character Generator
Use it to prepare identifiable text-layout fixtures or check how an editor, serializer, or renderer handles a single directional control.
How to use Random Unicode Bidirectional Control Character Generator and understand its results
- Run without input fields, or send {} programmatically.
- Inspect the returned value by code point or escaped representation. Preserve the exact string when inserting it into the intended fixture.
- Evaluate it in a defined surrounding string and renderer; use explicit matched pairs when your test needs balanced embeddings or isolates.
index = floor(randomDraw × 12); value = storedControls[index] The tool draws once and does not construct a paired or context-complete bidirectional sequence.
| Control group | Stored code points |
|---|---|
| Direction marks | U+061C, U+200E, U+200F |
| Embeddings, termination, overrides | U+202A, U+202B, U+202C, U+202D, U+202E |
| Isolates and termination | U+2066, U+2067, U+2068, U+2069 |
{
"input": {},
"randomDraw": 0.25,
"output": {
"value": "\u202a"
}
} Draw zero returns U+061C and a draw just below one returns U+2069. A closing control can be drawn without its opener. Invalid random draws cause an error.
Limitations and assumptions
The default source is Math.random; no seed input or cryptographic entropy guarantee is provided. Repeated runs may select the same result, and the distribution depends on the random source.
A single control is not a balanced text-layout test or a sanitization result. The tool does not inspect existing text, detect spoofing, remove controls, or predict a renderer’s final visual order.
Alternative or Complementary methods
Count or inspect the generated string when checking storage behavior. Noncharacters provide an encoding-policy fixture without this repertoire’s assigned directional semantics.
References
-
Unicode Standard Annex #9: Unicode Bidirectional Algorithm — Unicode Consortium
Similar or alternative tools
- Character Count
Inspect the control-containing string with a stated counting convention.
- Unicode Noncharacter Generator
Generate an internal-use scalar value for a different Unicode handling test.