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

PxTranslateToUTF()

Translate characters to UTF-8

Synopsis:

#include <photon/PxProto.h>

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

Library:

phexlib

Description:

This function translates a block of characters to Unicode UTF-8 (the internal Photon character set). The ctrl parameter specifies the encoding of the source 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 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 UTF-8 (MB_LEN_MAX == 3).
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 UTF-8 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 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) in 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 UTF-8 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(), PxTranslateFromUTF(), PxTranslateSet(), PxTranslateStateFromUTF(), PxTranslateStateToUTF(), 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/pxtranslatetoutf.html on line 177

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/pxtranslatetoutf.html on line 177