Opened 14 years ago

Closed 6 years ago

Last modified 5 years ago

#1385 closed defect (fixed)

reading gcs.csv & pcs.csv is not locale invariant

Reported by: baumann@… Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: OGR_SRS Version: unspecified
Severity: normal Keywords:
Cc: Markus Neteler

Description (last modified by warmerdam)

I have to set the locale to "setlocale(LC_ALL, "C");" before doing an "ogrSpatialRef->importFromEPSG(epsg);". This should be documented somewhere.

Even better: make the reading of the corresponding CSV files locale invariant by setting the locale to "C" temporarilly during import...

Change History (8)

comment:1 Changed 14 years ago by warmerdam


This is documented in the GDAL FAQ, and affects many aspects of the software.
A few critical points, such as GDALOpen(), do force the C locale temporarily
using the "CPLLocaleC  oLocaleForcer;" guard, but this can be somewhat expensive
so I am hesitant to sprinkle it all through the code. 

I'm going to leave this bug open for a while as a reminder to think further about
this issue. 

comment:2 Changed 14 years ago by warmerdam

I have modified ogrspatialreference.cpp's OGRPrintDouble() function to 
produce C locale style numbers with fixes up most problems building WKT

r10720 in trunk. 

Use CPLAtof() in ogr_fromepsg.cpp since all .csv values are C locale. 

r10721 in trunk.

Still more work needs to be done.

comment:3 Changed 14 years ago by warmerdam

Assorted additional locale improvements in :


still outstanding: 
proj_strod() use in gdal/port/cpl_conv.cpp (for DMStoDec, etc).

comment:4 Changed 14 years ago by warmerdam

Description: modified (diff)
Milestone: 1.5.0
Priority: highestnormal
Severity: majornormal

comment:5 Changed 14 years ago by warmerdam

Description: modified (diff)

comment:6 Changed 14 years ago by Markus Neteler

Cc: Markus Neteler added

comment:7 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: assignedclosed

Should be addressed by my recent global pass on locale related issues

comment:8 Changed 5 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.