uconvert_size(3alleg4)
β¨ NAME β¨
okay bestie, welcome to the uconvert_size(3alleg4) page from the Allegro manual π
uconvert_size β Number of bytes needed to store a string after conversion. Part of the Allegro game programming library. No cap, that's literally what she does. π
π¦ SYNOPSIS π¦
you pull her in like this, periodt:
#include <allegro.h>
int uconvert_size(const char *s, int type, int newtype);
π DESCRIPTION π
Okay so picture this: you have the specified string s, and you need to find out how many bytes are required to store it after a conversion from type to newtype. That's the vibe. She counts the mandatory zero terminator of the string too β yes, the null terminator is included, she's not being skipped, bestie. π
You can use U_CURRENT for either type or newtype as a shortcut to represent whatever text encoding format is currently selected. It's giving "I don't have the exact encoding name rn, just use the current one." π
Example, because seeing it is believing:
length = uconvert_size(old_string, U_CURRENT, U_UNICODE);
new_string = malloc(length);
ustrcpy(new_string, old_string);
π RETURN VALUE π
Returns the number of bytes required to store the string after conversion. That's the whole return value, and she ate. π β¨
π SEE ALSO π
need_uconvert(3alleg4)β bestie, this one is right there waiting for you π«Άdo_uconvert(3alleg4)β and this one too, go read, iykyk π
mwah π signing off from Allegro, version 4.4.3. stay iconic, bestie π¦β¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms