"de_Latn_LI" falls back to "de"

Description

If you call ures_open() with a locale ID of "de_Latn_LI", with any of the resource trees that come with ICU, you get back the resource bundle for "de" rather than the resource bundle for "de_LI".

You can get into this state (and I did) by using uloc_addLikelySubtags() to find the default language for Liechtenstein [pass in "und_LI" and get back "de_Latn_LI"] and passing the result to ures_open().

This happens because the resource bundle search code handles missing resource bundles simply by lopping fields off the end of the locale ID. There's no de_Latn_LI.txt, so next it looks for de_Latn.txt. It's not there either, so it tries de.txt, which is there, and so that's what it returns.

It'd be nice to enhance the search code to be less aggressive about throwing away the country code.

Assignee

Rich Gillam

Reporter

Rich Gillam

Components

Labels

None

Reviewer

None

Priority

medium

Time Needed

None

Fix versions

Configure