al_utf16_width(3alleg5)

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

πŸ’– al_utf16_width β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_utf16_width(3alleg5) page, you're gonna eat this one UP ✨


πŸŽ€ NAME πŸŽ€

al_utf16_width β€” it's an Allegro 5 API thing, and it's literally just here to tell you how thicc a character gets when it goes to UTF-16 school πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

size_t al_utf16_width(int c)

like yes, one include, one function, no drama πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, bestie πŸ“ β€” this function takes a code point and tells you the number of bytes it would take up once it's been encoded in UTF-16.

and the answer is genuinely so simple it's giving minimalism:

  • for legal code point values, you're getting either 2 or 4 bytes, periodt. no in-between, no chaos, just those two options 🌈
  • for anything that isn't a legal code point value? it returns 0 πŸ’€

that's it. that's the whole function. no cap, it's iconic for how unbothered it is.

ngl if you get a 0 back, that's your sign that whatever you passed in was not a legal code point, so maybe don't go encoding it anywhere πŸ™ˆ

🫢 SEE ALSO 🫢


and that's the whole page, bestie!! this came to you straight from the Allegro reference manual, page al_utf16_width(3alleg5) β€” go forth and measure your code points responsibly πŸ’œπŸ§šβ­

πŸ“¦ where this page comes from