Skip to main content

split_utf16le_on_nul

Function split_utf16le_on_nul 

Source
pub fn split_utf16le_on_nul(bytes: &[u8]) -> Vec<DecodedUtf16>
Expand description

Split a UTF-16LE slice on NUL code units and decode every segment.

The split is structural and total: n NULs yield n + 1 segments, empty ones included, and an empty input yields one empty segment. A trailing NUL therefore produces a trailing empty segment. Callers that want a terminator convention — such as “stop at the first empty segment” — apply it themselves, where the knowledge of that convention lives.