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

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

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

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 UChars). 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.
The pointer to destination buffer. ICU 2.0
See also:


Definition at line 718 of file ustrtrns.c.

References NULL, and U_SENTINEL.

    return u_strFromUTF8WithSub(
            dest, destCapacity, pDestLength,
            src, srcLength,
            U_SENTINEL, NULL,

Generated by  Doxygen 1.6.0   Back to index