diff --git a/icu4c/source/i18n/anytrans.cpp b/icu4c/source/i18n/anytrans.cpp index 45e97e44755..d46668ec910 100644 --- a/icu4c/source/i18n/anytrans.cpp +++ b/icu4c/source/i18n/anytrans.cpp @@ -309,7 +309,7 @@ static UScriptCode scriptNameToCode(const UnicodeString& name) { UBool isInvariant = uprv_isInvariantUString(name.getBuffer(), nameLen); if (isInvariant) { - name.extract(0, nameLen, buf, sizeof(buf), US_INV); + name.extract(0, nameLen, buf, (int32_t)sizeof(buf), US_INV); buf[127] = 0; // Make sure that we NULL terminate the string. } if (!isInvariant || uscript_getCode(buf, &code, 1, &ec) != 1 || U_FAILURE(ec)) diff --git a/icu4c/source/i18n/translit.cpp b/icu4c/source/i18n/translit.cpp index 61b7283a4f6..fb7322178d5 100644 --- a/icu4c/source/i18n/translit.cpp +++ b/icu4c/source/i18n/translit.cpp @@ -790,7 +790,7 @@ UnicodeString& U_EXPORT2 Transliterator::getDisplayName(const UnicodeString& id, uprv_strcpy(key, RB_SCRIPT_DISPLAY_NAME_PREFIX); args[j].getString(s); if (uprv_isInvariantUString(s.getBuffer(), s.length())) { - s.extract(0, sizeof(key)-length-1, key+length, sizeof(key)-length-1, US_INV); + s.extract(0, sizeof(key)-length-1, key+length, (int32_t)sizeof(key)-length-1, US_INV); resString = bundle.getStringEx(key, status);