uconvert(3)

NAME
uconvert

SYNOPSIS
#include <allegro.h>

char *uconvert(const char *s, int type, char *buf, int newtype, int size);

DESCRIPTION
Higher level function running on top of do_uconvert(). This function converts the specified string from type to newtype, storing at most size bytes into the output buf, but it checks before doing the conversion, and doesn't bother if the string formats are already the same (either both types are equal, or one is ASCII, the other is UTF-8, and the string contains only 7 bit ASCII characters). If a conversion was performed it returns a pointer to buf, otherwise it returns a copy of s, so you must use the return value rather than assuming that the string will always be moved to buf. As a convenience, if buf is NULL it will convert the string into an internal static buffer. You should be wary of using this feature, though, because that buffer will be overwritten the next time this routine is called, so don't expect the data to persist across any other library calls.

SEE ALSO
set_uformat(3), need_uconvert(3), uconvert(3), uconvert_ascii(3), uconvert_toascii(3)