Skip to main content

Module utf16

Module utf16 

Source
Expand description

UTF-16 code-unit measurement.

The Google Docs API expresses every Location.index and range bound in UTF-16 code units (the JavaScript string convention), not bytes or Unicode scalar values. This module is the single authority for that arithmetic (domain invariant DI-7); other modules MUST route length calculations through it rather than using str::len() or chars().count().

Functionsยง

len_utf16
Count the UTF-16 code units in text.