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

U_STABLE int32_t U_EXPORT2 uloc_getScript ( const char *  localeID,
char *  script,
int32_t  scriptCapacity,
UErrorCode err 
)

Gets the script code for the specified locale.

Parameters:
localeID the locale to get the ISO language code with
script the language code for localeID
scriptCapacity the size of the language buffer to store the language code with
err error information if retrieving the language code failed
Returns:
the actual buffer size needed for the language code. If it's greater than scriptCapacity, the returned language code will be truncated. ICU 2.8

Definition at line 1849 of file uloc.c.

References NULL, and U_FAILURE.

{
    int32_t i=0;

    if(err==NULL || U_FAILURE(*err)) {
        return 0;
    }

    if(localeID==NULL) {
        localeID=uloc_getDefault();
    }

    /* skip the language */
    ulocimp_getLanguage(localeID, NULL, 0, &localeID);
    if(_isIDSeparator(*localeID)) {
        i=ulocimp_getScript(localeID+1, script, scriptCapacity, NULL);
    }
    return u_terminateChars(script, scriptCapacity, i, err);
}


Generated by  Doxygen 1.6.0   Back to index