ImageGear for C and C++ on Windows v19.10 - Updated
IG_REC_util_unicode_to_codepage_length_get
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Utility Functions > IG_REC_util_unicode_to_codepage_length_get

Gets the length the Unicode character will require if converted into the current code page.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_util_unicode_to_codepage_length_get(
   AT_WCHAR Unicode,
   LPAT_INT lpCodepageLength
);

Arguments:

Name Type Description
Unicode AT_WCHAR Character code to be converted.
lpCodepageLength LPAT_INT Address of a variable to receive the number of bytes needed for the converted character.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;
AT_INT iActualLen = 0;

ErrCount += IG_load_file("Image.tif", &higImage);
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_image_recognize(higRecImage);

ErrCount += IG_REC_output_codepage_set("Windows ANSI");
ErrCount += IG_REC_util_unicode_to_codepage_length_get(L'�', &iActualLen);
//...

ErrCount += IG_REC_image_delete(higRecImage);
ErrCount += IG_image_delete(higImage);

Remarks:

The current Code Page can be changed by a previous IG_REC_output_codepage_set function call. The converted character can be retrieved with the IG_REC_util_unicode_to_codepage function call.