This example shows how to convert a Unicode character to uppercase.

#include <stdio.h>
#include <unidef.h>

int main(void) {

LocaleObject  locale_object;

UniChar       uni_lwr = L'c';
UniChar       uni_upr;
int           rc;


         /*****************************************************************/
         /* 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;
         }

         uni_upr = UniTransUpper(locale_object, uni_lwr);

         return (ULS_SUCCESS);


}


[Back: UniTransUpper - Related Functions]
[Next: UniTransUpper - Topics]