This example shows how to map a country code to a locale name.
#include <stdio.h> #include <unidef.h> int main(void) { UniChar ucs_locale_name[8]; size_t num_elems = 8; ULONG country_num = 1; LocaleObject locale_object = NULL; int rc = ULS_SUCCESS; /*****************************************************************/ /* Convert country number to a locale name */ /*****************************************************************/ rc = UniMapCtryToLocale(country_num, ucs_locale_name, num_elems); if (rc != ULS_SUCCESS) { printf("UniMapCtryToLocale error: return code = %u\n", rc); return 1; } rc = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, ucs_locale_name, &locale_object); if (rc != ULS_SUCCESS) { printf("UniCreateLocaleObject error: return code = %u\n", rc); return 1; } return ULS_SUCCESS; }