This example shows how to set a conversion object.

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

int main(void) {

uconv_attribute_t   attr;

UconvObject         uconv_object = NULL;
int                 rc = ULS_SUCCESS;

         /********************************************************************/
         /* Create a conversion object based upon the process codepage       */
         /* setting with the path modifier set                               */
         /********************************************************************/

         rc = UniCreateUconvObject((UniChar *)L"@path=yes", &uconv_object);

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

         /* Query the conversion object */

         rc = UniQueryUconvObject(uconv_object, &attr,
                                  sizeof(uconv_attribute_t), NULL,
                                  NULL, NULL);

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

         /* Turn the path modifier and display attributes on */

         attr.converttype = attr.converttype | CVTTYPE_PATH;
         attr.displaymask = DSPMASK_DISPLAY;

         rc = UniSetUconvObject(uconv_object, &attr);

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

         return ULS_SUCCESS;


}


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