[Fdo-trac] [fdo-trac] #878: Regression: Common Expression Engine cannot understand scientific notation when the coefficient is a decimal
FDO
trac_fdo at osgeo.org
Sun Dec 22 20:27:56 PST 2013
#878: Regression: Common Expression Engine cannot understand scientific notation
when the coefficient is a decimal
----------------------------+-----------------------------------------------
Reporter: christinebao | Owner: david.ji@…
Type: defect | Status: new
Priority: major | Milestone: 3.8.0
Component: FDO API | Version: 3.8.0
Severity: 3 | Keywords:
External_id: DE6337 |
----------------------------+-----------------------------------------------
Comment(by christinebao):
In German version, the filter like “Area2D(geometry) > 1.5e+11” doesn’t
work.
The reason is that, in FdoLex::getnumber, it always set ‘.’ as the decimal
point. And later, it invokes _wtof to convert the string to double value.
Actually, _wtof internally invokes _wtof_l with a null locale, and _wtof_l
will use the current or default locale to convert the string if the input
locale is null. In English locale, the decimal point is ‘.’, but in German
or some other locales, the decimal point might be ‘,’ or some other
characters, this leads to the incorrect convert from a string to a double
value. E.g. “1.5e+11” will be converted to 1.0 in German locale.
So the fix is quite straight forward, get the current locale and the
decimal point from the system API localeconv, and set the decimal point
into the string which will be converted to a double value.
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/878#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list