Function encode_utf_8e_128_buf

Source
pub fn encode_utf_8e_128_buf(buf: &mut [u8], codepoint: u128) -> usize
Expand description

Encodes a Unicode scalar value or an extended (> U+10FFFF) 128‑bit integer using the UTF‑8e‑128 scheme.

For values <= 0x10_FFFF this produces standard UTF‑8 (1–4 bytes). For larger values it emits: 0: 0xFF 1: 10LLLLLL (1 <= L <= 22) number of payload continuation bytes 2+: L payload continuation bytes 10bbbbbb … (big‑endian 6‑bit groups) Returns the number of bytes written.

Panics if the provided buffer is too small (needs up to 24 bytes).