Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 8

PxTranslateFromUTF()

Translate characters from UTF-8

Synopsis:

#include <photon/PxProto.h>

int PxTranslateFromUTF( struct PxTransCtrl *ctrl, 
                        const char *src, 
                        int maxsrc,
                        int *srctaken, 
                        char *dst,
                        int maxdst, 
                        int *dstmade);

Library:

phexlib

Description:

PxTranslateFromUTF() is used to translate a block of characters from UTF-8 (the internal Photon character set). The ctrl parameter specifies the encoding of the destination characters and must be the pointer returned by a previous call to PxTranslateSet() to install this encoding.

The parameters are as follows:

src
a pointer to the buffer containing the source UTF-8 characters. If this is NULL, no translation is performed, and the function returns the worst-case number of bytes required to hold a character in the current encoding.
maxsrc
the length of the contents in the source buffer (in bytes). No more than this number of bytes are read.
dst
a pointer to the buffer where the encoded characters should be placed. If this is NULL, no data is copied but the translation is still performed to calculate the length required to store the converted data.
maxdst
the length of the destination buffer (in bytes). No more than this number of bytes will be written; if this is 0, the buffer is assumed to be large enough to hold the entire encoding.
srctaken
this must point to an integer, which will be updated to reflect the number of bytes consumed from the source buffer src. This value may be smaller than maxsrc (if the given destination buffer would overflow or if the final input character of a multibyte UTF-8 sequence is incomplete).
dstmade
this must point to an integer, which will be updated to reflect the number of bytes produced (or would be produced) into the destination buffer dst. This value may be smaller than maxdst (if the given source buffer is exhausted or if the final output character of a multibyte sequence would be incomplete).

Returns:

0
Success.
-1
An error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PxTranslateList(), PxTranslateSet(), PxTranslateStateFromUTF(), PxTranslateStateToUTF(), PxTranslateToUTF(), PxTranslateUnknown()

Unicode Multilingual Support in the Photon Programmer's Guide

mbtowc(), wctomb() in the QNX Neutrino Library Reference


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 179

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/px/pxtranslatefromutf.html on line 179