Opened 17 years ago

Closed 9 years ago

Last modified 9 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 by warmerdam, 17 years ago

Konstantin, 

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 by warmerdam, 17 years ago

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

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 by warmerdam, 17 years ago

Assorted additional locale improvements in :
ogr_srs_validate.cpp
ogr_srs_proj4.cpp
ogr_spatialreference.cpp

r10725

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

comment:4 by warmerdam, 17 years ago

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

comment:5 by warmerdam, 17 years ago

Description: modified (diff)

comment:6 by Markus Neteler, 17 years ago

Cc: Markus Neteler added

comment:7 by Even Rouault, 9 years ago

Milestone: 1.8.12.0
Resolution: fixed
Status: assignedclosed

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

comment:8 by Even Rouault, 9 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.