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

U_STABLE const char* U_EXPORT2 uloc_getISO3Country ( const char *  localeID  ) 

Gets the ISO country code for the specified locale.

Parameters:
localeID the locale to get the ISO country code with
Returns:
country the ISO country code for localeID ICU 2.0

Definition at line 2003 of file uloc.c.

References NULL, U_FAILURE, U_ZERO_ERROR, and ULOC_LANG_CAPACITY.

{
    int16_t offset;
    char cntry[ULOC_LANG_CAPACITY];
    UErrorCode err = U_ZERO_ERROR;
    
    if (localeID == NULL)
    {
        localeID = uloc_getDefault();
    }
    uloc_getCountry(localeID, cntry, ULOC_LANG_CAPACITY, &err);
    if (U_FAILURE(err))
        return "";
    offset = _findIndex(COUNTRIES, cntry);
    if (offset < 0)
        return "";
    
    return COUNTRIES_3[offset];
}


Generated by  Doxygen 1.6.0   Back to index