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

U_STABLE int32_t U_EXPORT2 ucsdet_getUChars ( const UCharsetMatch ucsm,
UChar *  buf,
int32_t  cap,
UErrorCode status 

Get the entire input text as a UChar string, placing it into a caller-supplied buffer. A terminating NUL character will be appended to the buffer if space is available.

The number of UChars in the output string, not including the terminating NUL, is returned.

If the supplied buffer is smaller than required to hold the output, the contents of the buffer are undefined. The full output string length (in UChars) is returned as always, and can be used to allocate a buffer of the correct size.

ucsm The charset match object.
buf A UChar buffer to be filled with the converted text data.
cap The capacity of the buffer in UChars.
status Any error conditions are reported back in this variable.
The number of UChars in the output string.
ICU 3.6

Definition at line 169 of file ucsdet.cpp.

References U_FAILURE.

    if(U_FAILURE(*status)) {
        return 0;

    return ((CharsetMatch *) ucsm)->getUChars(buf, cap, status);

Generated by  Doxygen 1.6.0   Back to index