Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE char* U_EXPORT2 u_strToUTF8 ( char *  dest,
int32_t  destCapacity,
int32_t *  pDestLength,
const UChar *  src,
int32_t  srcLength,
UErrorCode pErrorCode 
)

Convert a UTF-16 string to UTF-8. If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.

Parameters:
dest A buffer for the result string. The result will be zero-terminated if the buffer is large enough.
destCapacity The size of the buffer (number of chars). If it is 0, then dest may be NULL and the function will only return the length of the result without writing any of the result string (pre-flighting).
pDestLength A pointer to receive the number of units written to the destination. If pDestLength!=NULL then *pDestLength is always set to the number of output units corresponding to the transformation of all the input units, even in case of a buffer overflow.
src The original source string
srcLength The length of the original string. If -1, then src must be zero-terminated.
pErrorCode Must be a valid pointer to an error code value, which must not indicate a failure before the function call.
Returns:
The pointer to destination buffer. ICU 2.0
See also:
u_strToUTF8WithSub

u_strFromUTF8

Definition at line 1235 of file ustrtrns.c.

References NULL, and U_SENTINEL.

                                   {
    return u_strToUTF8WithSub(
            dest, destCapacity, pDestLength,
            pSrc, srcLength,
            U_SENTINEL, NULL,
            pErrorCode);
}


Generated by  Doxygen 1.6.0   Back to index