Skip to content

Commit

Permalink
ICU-22520 doc: uloc_getName() & others may fail
Browse files Browse the repository at this point in the history
for example with a U_ILLEGAL_ARGUMENT_ERROR since PR #2813
in some cases where the implementation may have
returned with a misleading U_BUFFER_OVERFLOW_ERROR
  • Loading branch information
markusicu committed Apr 15, 2024
1 parent d8ee684 commit 0379e63
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions icu4c/source/common/unicode/uloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ uloc_setDefault(const char* localeID,
/**
* Gets the language code for the specified locale.
*
* This function may return with a failure error code for certain kinds of inputs
* but does not fully check for well-formed locale IDs / language tags.
*
* @param localeID the locale to get the ISO language code with
* @param language the language code for localeID
* @param languageCapacity the size of the language buffer to store the
Expand All @@ -417,6 +420,9 @@ uloc_getLanguage(const char* localeID,
/**
* Gets the script code for the specified locale.
*
* This function may return with a failure error code for certain kinds of inputs
* but does not fully check for well-formed locale IDs / language tags.
*
* @param localeID the locale to get the ISO language code with
* @param script the language code for localeID
* @param scriptCapacity the size of the language buffer to store the
Expand All @@ -435,6 +441,9 @@ uloc_getScript(const char* localeID,
/**
* Gets the country code for the specified locale.
*
* This function may return with a failure error code for certain kinds of inputs
* but does not fully check for well-formed locale IDs / language tags.
*
* @param localeID the locale to get the country code with
* @param country the country code for localeID
* @param countryCapacity the size of the country buffer to store the
Expand All @@ -453,6 +462,9 @@ uloc_getCountry(const char* localeID,
/**
* Gets the variant code for the specified locale.
*
* This function may return with a failure error code for certain kinds of inputs
* but does not fully check for well-formed locale IDs / language tags.
*
* @param localeID the locale to get the variant code with
* @param variant the variant code for localeID
* @param variantCapacity the size of the variant buffer to store the
Expand All @@ -471,6 +483,10 @@ uloc_getVariant(const char* localeID,

/**
* Gets the full name for the specified locale.
*
* This function may return with a failure error code for certain kinds of inputs
* but does not fully check for well-formed locale IDs / language tags.
*
* Note: This has the effect of 'canonicalizing' the ICU locale ID to
* a certain extent. Upper and lower case are set as needed.
* It does NOT map aliased names in any way.
Expand Down

0 comments on commit 0379e63

Please sign in to comment.