al_utf16_encode(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

🌸 NAME 🌸

okay so, bestie: this is al_utf16_encode from the Library Functions Manual, and it’s serving Allegro 5 API energy. That’s the whole name vibe πŸ’…βœ¨


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

size_t al_utf16_encode(uint16_t s[], int32_t c)

πŸ’… DESCRIPTION πŸ’…

So basically, al_utf16_encode encodes the specified code point to UTF-16 into the buffer s. Iconic little conversion moment, no cap πŸŽ€

The buffer must have enough space to hold the encoding, which takes either 2 or 4 bytes. Like, please give it room to breathe, bestie 😭

⚠️ This routine will refuse to encode code points above 0x10FFFF. It’s giving boundaries, and honestly? Respect 🫢

It returns the number of bytes written, which is the same as that returned by al_utf16_width(3). Slay, consistent return values πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹


πŸŽ€ source/version: Allegro reference manual Β· date: not listed on this page Β· bye bestie, go encode responsibly πŸ’œπŸ«Ά

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms