blob: 8d93fd7bcca2895d046595bae692a9f00c6fc395 [file] [log] [blame]
diff --git a/icu4c/source/common/uloc_tag.cpp b/icu4c/source/common/uloc_tag.cpp
index 87b9f63f27..2fb136f22a 100644
--- a/icu4c/source/common/uloc_tag.cpp
+++ b/icu4c/source/common/uloc_tag.cpp
@@ -1901,7 +1901,9 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta
t->language = T_CString_toLowerCase(pSubtag);
pLastGoodPosition = pSep;
- next = EXTL | SCRT | REGN | VART | EXTS | PRIV;
+ next = SCRT | REGN | VART | EXTS | PRIV;
+ if (subtagLen <= 3)
+ next |= EXTL;
continue;
}
}
@@ -2150,7 +2150,7 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta
}
}
if (next & PRIV) {
- if (uprv_tolower(*pSubtag) == PRIVATEUSE) {
+ if (uprv_tolower(*pSubtag) == PRIVATEUSE && subtagLen == 1) {
char *pPrivuseVal;
if (pExtension != NULL) {