al_utf8_encode(3alleg5)
β¨ 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 π¦
al_utf16_encode(3alleg5)β the UTF-16 sibling, if you wanna go say hi.
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
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms