Next: , Previous: Elementary string checks, Up: unistr.h


4.2 Elementary string conversions

The following functions perform conversions between the different forms of Unicode strings.

— Function: uint16_t * u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf, size_t *lengthp)

Converts an UTF-8 string to an UTF-16 string.

— Function: uint32_t * u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf, size_t *lengthp)

Converts an UTF-8 string to an UTF-32 string.

— Function: uint8_t * u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf, size_t *lengthp)

Converts an UTF-16 string to an UTF-8 string.

— Function: uint32_t * u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf, size_t *lengthp)

Converts an UTF-16 string to an UTF-32 string.

— Function: uint8_t * u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf, size_t *lengthp)

Converts an UTF-32 string to an UTF-8 string.

— Function: uint16_t * u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf, size_t *lengthp)

Converts an UTF-32 string to an UTF-16 string.