Re: API change proposal: ucurr_forLocale

Markus Scherer <[email protected]> Tue, 11 Nov 2003 15:48:46 -0800
Newsgroups gmane.comp.lib.icu.general
Organization IBM
Message-ID <[email protected]>
Vladimir Weinstein wrote:
>  * @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);

The new signature should return the int32_t result length instead of the UChar *buffer. Even though 
this means more changes where this function is used (rarely), it does not make sense to have this 
one function work differently from all others in ICU where we write into fill-in buffers.

See "Using C Strings: NUL-Terminated vs. Length Parameters"/"Output string" in 
http://oss.software.ibm.com/icu/userguide/strings.html

markus