al_ustr_size_utf16(3alleg5)
β¨ al_ustr_size_utf16 β Allegro 5 API β¨
okay bestie, so you know how this whole page lives in the Allegro 5 API section of the al_ustr_size_utf16(3alleg5) manual? yeah. that's the vibe. π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
size_t al_ustr_size_utf16(const ALLEGRO_USTR *us)
like, literally that. that's the whole thing. no cap. π«Ά
π¦ DESCRIPTION π¦
so this function hands you back the number of bytes you'd need to encode that string in UTF-16 β and yes, it counts the terminating 0 too, don't forget the lil guy, he matters π
the way you'd usually use it? you call this first, before al_ustr_encode_utf16(3alleg5), purely to figure out how big your buffer needs to be before you go ahead and allocate it. it's giving "measure twice, cut once" but make it Unicode. π
not me being the pre-flight check for your buffer allocation. main character energy fr fr. π
π SEE ALSO π
k bye bestie, go allocate responsibly π
this lil page came straight out of the Allegro reference manual β al_ustr_size_utf16(3alleg5) edition, periodt πβ¨πΈ
π¦ 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