This example shows how to convert a code page number to a Unicode string.

#include <stdio.h>
#include <uconv.h>

int main(void) {

UniChar      ucs_code_page[12];
size_t       num_elems = 12;
UconvObject  uconv_object = NULL;
int          rc = ULS_SUCCESS;

         /********************************************************************/
         /* Convert a code page number to a unichar string                   */
         /********************************************************************/


         rc = UniMapCpToUcsCp(850, ucs_code_page, num_elems);

         if (rc != ULS_SUCCESS) {
           printf("UniMapCpToUcsCp error: return code = %u\n", rc);
           return 1;
         }

         rc = UniCreateUconvObject(ucs_code_page, &uconv_object);

         if (rc != ULS_SUCCESS) {
           printf("UniCreateUconvObject error: return code = %u\n", rc);
           return 1;
         }

         return ULS_SUCCESS;


}


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