virtual void NumberFormat:arse(const UnicodeString & text, Formattable & result, UErrorCode & status)
fails to parse numbers from 1E+10 to 1E+18.
Numbers up to 1E+9 and above 1E+19 work.
The reason is that the numbers in the non-working range from 1E+10 to 1E+18 are parsed into an int64 (the smaller ones are parsed into a long, the bigger ones in to a double)and then
double Formattable::getDouble(UErrorCode & status)
fails to get the int64 correctly because of a problem in
in the file digitlst.cpp.
Here is a patch which fixes the problem:
The problem occurs because in the original code
“copy” created in this block:
goes out of scope here, therefore the pointer workingNum points to
something not existing anymore and then this pointer is used
in the code which follows:
This has the effect that 0 is returned by int64_t DigitList::getInt64()
when something like "1E+10" is parsed.
And sometimes it even crashes.
The patch above is against libicu 4.4.2 but the problem apparently still exists in 4.6RC2, I checked the source in this tarball:
The problem was first reported here:
By the way, I noticed that since version 4.4.2, icu seems to be case
sensitive when parsing the exponential symbol, version 4.4.1 could
parse both “3.4e+38” '''and''' “3.4E+38” in en_GB locale, version
4.4.2 parses only “3.4E+38” in en_GB locale. Was this change done on
Milestone 4.7.1 deleted