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/pxtranslatestatetoutf.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/pxtranslatestatetoutf.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/pxtranslatestatetoutf.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/pxtranslatestatetoutf.html on line 8

PxTranslateStateToUTF()

Translate characters to UTF-8, using an internal state buffer

Synopsis:

#include <photon/PxProto.h>

int PxTranslateStateToUTF( struct PxTransCtrl *ctrl, 
                           const char *src, 
                           int maxsrc, 
                           int *consumed, 
                           char *dst, 
                           int maxdst );

Library:

phexlib

Description:

This function is similar to PxTranslateToUTF() except that it uses an internal state buffer.

Since many encodings are multibyte, it's possible (in cases where input data is being provided from a file or socket) for a conversion to end in the middle of a multibyte sequence or for the output buffer to be too small to hold the complete encoding of the final character. This routine buffers any partial encoding, using those bytes as the start of a character sequence for the next PxTranslateStateToUTF() call.

This routine uses an appropriately sized temporary overflow buffer, allocated by the PxTranslateSet() routine.

The parameters src and maxsrc specify the input buffer; the parameters dst and maxdst specify the output UTF-8 buffer. These have the same meaning as in the PxTranslateToUTF() function. The consumed parameter will be updated with the number of bytes converted from the source buffer; this may be NULL if this information isn't required (i.e. if the source is always correctly encoded and the destination buffer is always sufficiently large).

Returns:

The number of bytes produced in the destination buffer, or -1 on error.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

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

Unicode Multilingual Support in the Photon Programmer's Guide


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/pxtranslatestatetoutf.html on line 128

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/pxtranslatestatetoutf.html on line 128