Lines Matching refs:localeID
54 locale_getKeywords(const char *localeID,
524 #define _hasBCP47Extension(id) (id && uprv_strstr(id, "@") == NULL && getShortestSubtagLength(localeID) == 1)
532 /* Gets the size of the shortest subtag in the given localeID. */
533 static int32_t getShortestSubtagLength(const char *localeID) {
534 int32_t localeIDLength = uprv_strlen(localeID);
541 if (localeID[i] != '_' && localeID[i] != '-') {
564 locale_getKeywordsStart(const char *localeID) {
566 if((result = uprv_strchr(localeID, '@')) != NULL) {
577 if((result = uprv_strchr(localeID, *charToFind)) != NULL) {
634 _getKeywords(const char *localeID,
647 const char* pos = localeID;
815 locale_getKeywords(const char *localeID,
821 return _getKeywords(localeID, prev, keywords, keywordCapacity,
827 uloc_getKeywordValue(const char* localeID,
839 if(status && U_SUCCESS(*status) && localeID) {
843 if (_hasBCP47Extension(localeID)) {
844 _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), status);
846 tmpLocaleID=localeID;
1218 ulocimp_getLanguage(const char *localeID,
1226 if(_isIDPrefix(localeID)) {
1228 language[i]=(char)uprv_tolower(*localeID);
1234 localeID+=2;
1238 while(!_isTerminator(*localeID) && !_isIDSeparator(*localeID)) {
1240 language[i]=(char)uprv_tolower(*localeID);
1244 lang[i]=(char)uprv_tolower(*localeID);
1247 localeID++;
1259 *pEnd=localeID;
1265 ulocimp_getScript(const char *localeID,
1272 *pEnd = localeID;
1276 while(!_isTerminator(localeID[idLen]) && !_isIDSeparator(localeID[idLen])
1277 && uprv_isASCIILetter(localeID[idLen])) {
1285 *pEnd = localeID+idLen;
1291 script[0]=(char)uprv_toupper(*(localeID++));
1294 script[i]=(char)uprv_tolower(*(localeID++));
1304 ulocimp_getCountry(const char *localeID,
1313 while(!_isTerminator(localeID[idLen]) && !_isIDSeparator(localeID[idLen])) {
1315 cnty[idLen]=(char)uprv_toupper(localeID[idLen]);
1335 country[i]=(char)uprv_toupper(localeID[i]);
1339 localeID+=idLen;
1345 *pEnd=localeID;
1356 _getVariantEx(const char *localeID,
1365 while(!_isTerminator(*localeID)) {
1374 variant[i]=(char)uprv_toupper(*localeID);
1380 localeID++;
1387 /* keep localeID */
1388 } else if((localeID=locale_getKeywordsStart(localeID))!=NULL) {
1389 ++localeID; /* point after the '@' */
1393 while(!_isTerminator(*localeID)) {
1402 variant[i]=(char)uprv_toupper(*localeID);
1408 localeID++;
1416 _getVariant(const char *localeID,
1419 return _getVariantEx(localeID, prev, variant, variantCapacity, FALSE);
1556 uloc_openKeywords(const char* localeID,
1569 if (_hasBCP47Extension(localeID)) {
1570 _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), status);
1572 if (localeID==NULL) {
1573 localeID=uloc_getDefault();
1575 tmpLocaleID=localeID;
1620 * Canonicalize the given localeID, to level 1 or to level 2,
1627 _canonicalize(const char* localeID,
1648 if (_hasBCP47Extension(localeID)) {
1649 _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), err);
1651 if (localeID==NULL) {
1652 localeID=uloc_getDefault();
1654 tmpLocaleID=localeID;
1874 uloc_getParent(const char* localeID,
1885 if (localeID == NULL)
1886 localeID = uloc_getDefault();
1888 lastUnderscore=uprv_strrchr(localeID, '_');
1890 i=(int32_t)(lastUnderscore-localeID);
1895 if(i>0 && parent != localeID) {
1896 uprv_memcpy(parent, localeID, uprv_min(i, parentCapacity));
1902 uloc_getLanguage(const char* localeID,
1914 if(localeID==NULL) {
1915 localeID=uloc_getDefault();
1918 i=ulocimp_getLanguage(localeID, language, languageCapacity, NULL);
1923 uloc_getScript(const char* localeID,
1934 if(localeID==NULL) {
1935 localeID=uloc_getDefault();
1939 ulocimp_getLanguage(localeID, NULL, 0, &localeID);
1940 if(_isIDSeparator(*localeID)) {
1941 i=ulocimp_getScript(localeID+1, script, scriptCapacity, NULL);
1947 uloc_getCountry(const char* localeID,
1958 if(localeID==NULL) {
1959 localeID=uloc_getDefault();
1963 ulocimp_getLanguage(localeID, NULL, 0, &localeID);
1964 if(_isIDSeparator(*localeID)) {
1967 ulocimp_getScript(localeID+1, NULL, 0, &scriptID);
1968 if(scriptID != localeID+1) {
1970 localeID = scriptID;
1972 if(_isIDSeparator(*localeID)) {
1973 i=ulocimp_getCountry(localeID+1, country, countryCapacity, NULL);
1980 uloc_getVariant(const char* localeID,
1993 if (_hasBCP47Extension(localeID)) {
1994 _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), err);
1996 if (localeID==NULL) {
1997 localeID=uloc_getDefault();
1999 tmpLocaleID=localeID;
2033 if(!haveVariant && (localeID=uprv_strrchr(localeID, '@'))!=NULL) {
2034 i=_getVariant(localeID+1, '@', variant, variantCapacity);
2041 uloc_getName(const char* localeID,
2046 return _canonicalize(localeID, name, nameCapacity, 0, err);
2050 uloc_getBaseName(const char* localeID,
2055 return _canonicalize(localeID, name, nameCapacity, _ULOC_STRIP_KEYWORDS, err);
2059 uloc_canonicalize(const char* localeID,
2064 return _canonicalize(localeID, name, nameCapacity, _ULOC_CANONICALIZE, err);
2068 uloc_getISO3Language(const char* localeID)
2074 if (localeID == NULL)
2076 localeID = uloc_getDefault();
2078 uloc_getLanguage(localeID, lang, ULOC_LANG_CAPACITY, &err);
2088 uloc_getISO3Country(const char* localeID)
2094 if (localeID == NULL)
2096 localeID = uloc_getDefault();
2098 uloc_getCountry(localeID, cntry, ULOC_LANG_CAPACITY, &err);
2109 uloc_getLCID(const char* localeID)
2114 uloc_getLanguage(localeID, langID, sizeof(langID), &status);
2119 if (uprv_strchr(localeID, '@')) {
2126 len = uloc_getKeywordValue(localeID, "collation", collVal,
2132 len = uloc_getBaseName(localeID, tmpLocaleID,
2152 return uprv_convertToLCID(langID, localeID, &status);