DigitList::getDouble() produces wrong result after changing locale settings

Description

DigitList::getDouble() uses global gDecimal, which is derived from sprintf(rep, "%+1.1f", 1.0) at the first call to this function. However, if system locale changes, this value stays the same, and then when getDouble uses uprv_strtod (which is just system strtod), this function would expect current decimal separator, set by the current locale, but would instead receive one from gDecimal, and thus fail to produce correct result.
It is not clear why these functions should depend on system locale separator (and not locale given in the number formatter, etc.) - but it definitely breaks if locale changes between calls to DigitList::getDouble() and same number with same number formatter setting is not parsed correctly anymore.

Assignee

Steven R. Loomis

Reporter

TracBot

Components

Labels

Reviewer

None

Priority

assess

Time Needed

None

Fix versions

None
Configure