`uloc_acceptLanguage` does not fall back correctly when the list of available locales does not contain long locales

Description

Here: https://github.com/unicode-org/icu/blob/master/icu4c/source/common/uloc.cpp#L2374

The loop should be:

```
for (;maxLen>0;maxLen--) {
// loop body
}
```

Otherwise, when the list of available locales consists only of 2-letter locales ("fr", "es", "de"), the locale "es_MX" won't fall back to "es".

Activity

Show:
Markus Scherer
March 8, 2020, 10:38 PM

Thanks, but this is no longer necessary now that I rewrote these functions with PR #1022 "reimplement acceptLanguage() using the LocaleMatcher"

Filip Filmar
December 28, 2019, 12:08 PM

PR with a fix and regression test:

Fixed by Other Ticket

Assignee

Markus Scherer

Reporter

Filip Filmar

Components

Priority

major

Time Needed

Minutes

Fix versions