Bidi::UTF16::TextSource
Text source utilities for UTF-16 (Array(UInt16))
Provides character iteration and access methods for UTF-16 encoded text, with proper handling of surrogate pairs and invalid sequences.
Class methods
Get character at index with its length in code units
Iterates over characters in a UTF-16 array, handling surrogate pairs
Correctly processes:
- Single code units (U+0000 to U+D7FF, U+E000 to U+FFFF)
- Surrogate pairs (high: 0xD800-0xDBFF, low: 0xDC00-0xDFFF)
- Invalid sequences (replaced with U+FFFD REPLACEMENT CHARACTER)
Parameters:
text: UTF-16 encoded text asArray(UInt16)&block: Block to yield each character to