This example shows how to create and free a locale object.
#include <stdio.h> #include <unidef.h> int main(void) { LocaleObject locale_object = NULL; int rc = ULS_SUCCESS; /* Create a locale object for French in Canada */ rc = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"fr_CA", &locale_object); if (rc != ULS_SUCCESS) { printf("UniCreateLocaleObject error: return code = %u\n", rc); return 1; } /* Free the locale object that was just created */ rc = UniFreeLocaleObject(locale_object); if (rc != ULS_SUCCESS) { printf("UniFreeLocaleObject error: return code = %u\n", rc); return 1; } return ULS_SUCCESS; }