al_utf8_encode(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, welcome to the al_utf8_encode(3alleg5) page β€” that's the manual name, and this function is part of the Allegro 5 API. She's here to encode one code point into UTF-8, and she's very good at it. πŸ’…

🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

size_t al_utf8_encode(char s[], int32_t c)

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: you've got a code point, and you want it in UTF-8. al_utf8_encode takes that specified code point and encodes it into the buffer s. The buffer must have enough space to hold the encoding, because that encoding takes between 1 and 4 bytes β€” so like, size it right, bestie. 🫢

She will flat-out refuse to encode code points above 0x10FFFF. Not negotiable. No cap. πŸ›‘

Then she returns the number of bytes written, which is the same as the number returned by al_utf8_width(3alleg5). Consistent queen behavior, honestly. ✨

πŸ¦‹ SEE ALSO πŸ¦‹


Source/version: Allegro reference manual. Page: al_utf8_encode(3alleg5). Date: the footer didn't print one, so no date, bestie πŸŽ€. Bye and slay πŸ’œπŸ‘‘

πŸ“¦ where this page comes from