Re: Feedback wanted: fix approach for JB 4255?

Deborah Goldsmith <[email protected]> Wed, 1 Dec 2004 09:19:43 -0800
Newsgroups gmane.comp.lib.icu.general
Message-ID <[email protected]>
OK, I'll proceed with the approach I proposed.

Deborah

On Nov 29, 2004, at 5:59 PM, Deborah Goldsmith wrote:

> Any comments?
>
> Deborah
>
> On Nov 19, 2004, at 5:12 PM, Deborah Goldsmith wrote:
>> Hi,
>>
>> I just encountered JB 4255, which is yet another problem with setting 
>> warnings properly when fetching display names, this time in 
>> uloc_getDisplayName. The problem is that each individaul 
>> uloc_getDisplay* smashes the incoming status code, so the code 
>> returned by uloc_getDisplayName is the one from the last component of 
>> the name, not the union of any warnings encountered. You can read the 
>> bug for a slightly lengthier explanation.
>>
>> I know this is too late for 3.2, but I need to fix this in my copy. 
>> My proposed fix is to change uloc_getDisplay* to not smash the 
>> incoming error code when calling uloc_get*. uloc_getDisplay* already 
>> sets the output code if an error occurs, so we might as well use a 
>> local status code for the call to uloc_get*; that would preserve the 
>> incoming code. Does this seem like a reasonable approach? The other 
>> approach would be to have uloc_getDisplayName manually merge the 
>> warning codes from the component calls.
>>
>> By the way, uloc_getDisplay(Language/Script/Country/Variant) could 
>> share a common worker routine and just pass a pointer to a function 
>> to get the desired component, since 
>> uloc_get(Language/Script/Country/Variant) all share the same 
>> signature. That would save a bit of code. I filed JB 4256 for that.
>>
>> Deborah
>
> _______________________________________________
> icu mailing list
> [email protected]
> http://oss.software.ibm.com/developerworks/oss/mailman/listinfo/icu