[geos-devel] [GEOS] #260: Problem using locale with WKTReader

GEOS geos-trac at osgeo.org
Sat Jun 13 11:01:35 EDT 2009


#260: Problem using locale with WKTReader
-----------------------+----------------------------------------------------
 Reporter:  del        |       Owner:  geos-devel at lists.osgeo.org
     Type:  task       |      Status:  new                       
 Priority:  major      |   Milestone:  3.1.1                     
Component:  Default    |     Version:  3.0.3                     
 Severity:  Annoyance  |    Keywords:                            
-----------------------+----------------------------------------------------
 Hello,
 I spotted the following problem (on at least ubuntu and gentoo):

 When LANG=fr_FR.utf8 is set... WKTReader fails reading points.


 Giving "POINT (2154.7500000000000000 321.5380000000000109)" to WKTReader
 leads to the following error:
 Unable to handle the packet: ParseException: Expected number but
 encountered word: '2154.7500000000000000'.


 I checked in the source code... and WKTReader uses the strtod(...)
 function in io/StringTokenizer.cpp:76 which uses the locale to decide what
 looks like a number... or in French, we use "," instead of "." for the
 radix character.

 This is kind of a problem for an application which cannot "force" the
 locale to be the standard C one...

-- 
Ticket URL: <http://trac.osgeo.org/geos/ticket/260>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list