ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > PDF Component API Reference > PDF Component Functions Reference > IG_PDF_translate_to_host

Translates a string from Unicode or PDFDocEncoding to host encoding.


Copy Code
AT_ERRCOUNT ACCUAPI IG_PDF_translate_to_host(
        LPCSTR szInPDFStr,
        LONG nInPDFStrSize,
        LPSTR szOutHostStr,
        LONG nOutHostStrSize,
        LPLONG lpnOutHostStrBytes


Name Type Description
szInPDFStr LPCSTR Pointer to the string to translate (may point to the same memory as szOutHostStr, allowing strings to translate in place).
nInPDFStrSize LONG The length of szInPDFStr, in bytes.
szOutHostStr LPSTR Pointer to the translated string (may point to the same memory as szInPDFStr).
nOutHostStrSize LONG The length of the szOutHostStr buffer, in bytes.
lpnOutHostStrBytes LPLONG Number of bytes in the translated string szOutHostStr.

Return Value:

Error count

Supported Raster Image Formats:

This function does not process image pixels.


This function is useful when setting or retrieving displayed text that might be in Unicode, such as text that appears in a text annotation or bookmark.

A character that cannot be converted to the destination encoding is replaced with a space.

Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is MacRomanEncoding in Mac OS and WinAnsiEncoding in Windows. In UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8. See Appendix D in the PDF Reference for descriptions of MacRomanEncoding, WinAnsiEncoding, and PDFDocEncoding.

For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). See Section 5.6.4 in the PDF Reference for information on CMaps.

Use IG_PDF_get_host_encoding to determine if a system's host encoding is Roman or not.

Is this page helpful?
Yes No
Thanks for your feedback.