This example shows how to create and free a transform object.
#include <stdio.h> #include <unidef.h> int main(void) { LocaleObject locale_object = NULL; XformObject xform_object = NULL; int rc = ULS_SUCCESS; /*****************************************************************/ /* Assumes LANG environment variable set to a valid locale name, */ /* such as fr_FR */ /*****************************************************************/ rc = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &locale_object); if (rc != ULS_SUCCESS) { printf("UniCreateLocaleObject error: return code = %u\n", rc); return 1; } /* Create an upper case transform object */ rc = UniCreateTransformObject(locale_object, (UniChar *)L"lower", &xform_object); if (rc != ULS_SUCCESS) { printf("UniCreateTransformObject error: return code = %u\n", rc); return 1; } /* Free the transform object created by UniCreateTransformObject */ rc = UniFreeTransformObject(xform_object); if (rc != ULS_SUCCESS) { printf("UniFreeTransformObject error: return code = %u\n", rc); return 1; } return ULS_SUCCESS; }