Skip to main content

Module ucs2

Module ucs2 

Source
Expand description

UCS2 user data (23.038 §6.2.3). Encoded as UTF-16BE, so characters outside the BMP travel as surrogate pairs, as every current handset expects.

Enums§

Ucs2Error

Functions§

decode
UTF-16BE bytes → text. Unpaired surrogates and a trailing odd octet become U+FFFD.
decode_strict
Strict variant of decode.
encode
Text → UTF-16BE bytes.
units
Number of UTF-16 code units (2 octets each) for c.