al_ustr_new_from_utf16(3alleg5)
π al_ustr_new_from_utf16 π
okay bestie, welcome to the al_ustr_new_from_utf16(3alleg5) page, part of the Allegro 5 API β¨ she's a lil function, she's in the Allegro reference manual, and she is so good at exactly one thing. let's get into it π«Ά
β¨ NAME β¨
al_ustr_new_from_utf16 β it's giving Allegro 5 API, no cap π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
ALLEGRO_USTR *al_ustr_new_from_utf16(uint16_t const *s)
likeβ¦ look at her. one include, one function, zero drama π
π¦ DESCRIPTION π¦
So here's the tea, bestie π: this function creates a new string and puts a copy of s inside it. That's it, that's the whole job, and she eats every time π
But hold up, there are rules:
- The string
shas to be 0-terminated. The zero is the vibe check β when the function hits it, that's the end of the line, periodt. - The string
smust be encoded as UTF-16 β like, actually UTF-16, bestie. Don't roll up with some other encoding and act surprised. π
and then β and this is the important part, do NOT forget this β the string you get back must eventually be freed with al_ustr_free(3alleg5). It's not optional, it's not a suggestion, it's not "eh I'll do it later". Free your string. Your string is not gonna free itself, and that's on memory leaks π
π SEE ALSO π
al_ustr_new(3alleg5)β her cousin, her sister, her other option when your data isn't in UTF-16 π§
and that's the whole page, bestie!! this was the Allegro reference manual, al_ustr_new_from_utf16(3alleg5), Allegro version 5 β go free your strings and slay the day, ily, mwah ππβ¨
π¦ 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