Feedback wanted: fix approach for JB 4255?

Deborah Goldsmith <[email protected]> Fri, 19 Nov 2004 17:12:53 -0800
Newsgroups gmane.comp.lib.icu.general
Message-ID <[email protected]>
(resend with correct "from" address...)

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