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

U_STABLE const char* U_EXPORT2 ucsdet_getLanguage ( const UCharsetMatch ucsm,
UErrorCode status 
)

Get the RFC 3066 code for the language of the input data.

The Charset Detection service is intended primarily for detecting charsets, not language. For some, but not all, charsets, a language is identified as a byproduct of the detection process, and that is what is returned by this function.

CAUTION: 1. Language information is not available for input data encoded in all charsets. In particular, no language is identified for UTF-8 input data.

2. Closely related languages may sometimes be confused.

If more accurate language detection is required, a linguistic analysis package should be used.

The storage for the returned name string is owned by the UCharsetMatch, and will remain valid while the UCharsetMatch is valid.

Parameters:
ucsm The charset match object.
status Any error conditions are reported back in this variable.
Returns:
The RFC 3066 code for the language of the input data, or an empty string if the language could not be determined.
ICU 3.6

Definition at line 81 of file ucsdet.cpp.

References NULL, and U_FAILURE.

{
    if(U_FAILURE(*status)) {
        return NULL;
    }

    return ((CharsetMatch *) ucsm)->getLanguage();
}


Generated by  Doxygen 1.6.0   Back to index