ImageGear Professional DLL v17.1 for Windows Accusoft
IG_REC_util_unicode_to_codepage
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Utility Functions > IG_REC_util_unicode_to_codepage

Glossary Item Box

Converts a UNICODE character code to its representation in the current code page.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_util_unicode_to_codepage(
   AT_WCHAR Unicode,
   LPAT_BYTE pCodePageBuffer,
   AT_INT codepageBufferLength
);

Arguments:

Unicode Character code to be converted.
pCodePageBuffer Pointer of a variable to store the result of the conversion.
codepageBufferLength Length of the output buffer. Must be large enough to hold 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.

Remarks:

The current Code Page can be changed by a previous IG_REC_output_codepage_set function call. The length of the output character can be retrieved with the IG_REC_util_unicode_to_codepage_length_get function call.

Example:

  Copy Code
AT_ERRCOUNT ErrCount = 0;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;
LPAT_BYTE lpBuffer = 0;
AT_INT iBufLen = 0;
AT_WCHAR wcUnicode = L'�';
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(wcUnicode, &iActualLen);
lpBuffer = (LPAT_BYTE) malloc(iActualLen);
ErrCount += IG_REC_util_unicode_to_codepage(wcUnicode, lpBuffer, iActualLen);
//...

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

©2012. Accusoft Corporation. All Rights Reserved.