Function

utf32_encode

Encode to UTF-32 (native byte order).

Since v1.0
int32_t utf32_encode(
uchar c, uint32_t *buf)

Parameters 🔗

c in

Unicode scalar value.

buf out

Destination buffer for the encoded c.

Return Value 🔗

Returns the number of code units written to buf on success. Returns a negative integer if c is not a valid Unicode scalar value.

Discussion 🔗

Encodes the Unicode scalar value c as UTF-32 code unit(s) and writes them to buf. The length of buf must be at least one code unit.

If c is not a valid Unicode scalar value, buf remains unchanged and a negative integer is returned.

See Also 🔗