API change proposal: ucurr_forLocale

Vladimir Weinstein <[email protected]> Tue, 11 Nov 2003 13:49:18 -0800
Newsgroups gmane.comp.lib.icu.general
Message-ID <[email protected]>
Expiration: 11/18/2003

I'm proposing to change:
/**
  * Returns a currency code for the default currency in the given
  * locale.
  * @param locale the locale for which to retrieve a currency code
  * @param ec error code
  * @return a pointer to a 3-character ISO 4217 currency code, or
  * NULL if none is found.
  * @draft ICU 2.2
  */
U_CAPI const UChar* U_EXPORT2
ucurr_forLocale(const char* locale,
                 UErrorCode* ec);

to

/**
  * Returns a currency code for the specified currency in the given
  * locale. Currency codes are always of length 3. Currencies can be
  * specified by using the "currency" keyword ("en_US@currency=EUR").
  *
  * @param locale the locale for which to retrieve a currency code
  * @param buffer the fill in buffer for the currency code
  * @param bufferCapacity capacity of the fill in buffer.
  * @param ec error code
  * @return pointer to the buffer containing the currency code.
  * @draft ICU 2.8
  */
U_CAPI UChar* U_EXPORT2
ucurr_forLocale(const char* locale,
		UChar* buffer,
		int32_t bufferCapacity,
                 UErrorCode* ec);

This change is triggered by the need to support keywords for locales. This 
effectively means that any locale could come with any currency. Housekeeping 
becomes complicated in this case. Therefore, we want the user to supply us with 
a fill in buffer.

Thank you!

Regards,
v.

-- 
Vladimir Weinstein, IBM GCoC-Unicode/ICU  San Jose, CA [email protected]