Opened 17 years ago

Last modified 17 years ago

#1414 closed defect

world files and locale — at Version 7

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone: 1.4.1
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc: Markus Neteler

Description (last modified by warmerdam)

When operating in the C locale, GDAL cannot read world files using commas in place of a period as the decimal point (ie. typical of the "de" locale for instance).

Please modify the worldfile reading code to support either "." or "," as the decimal place regardless of the working locale. Basically, use the CPLAtof() function in place of atof().

(see GDALReadWorldFile() in gdal/gcore/gdal_misc.cpp)

Make sure a test of this is added to the test suite.

Change History (5)

comment:1 by warmerdam, 17 years ago

I'm working on this one tonight. 

comment:2 by warmerdam, 17 years ago

I have added a CPLAtofM() in cpl_strtod.cpp which accepts either "," or "." 
regardless of locale.  It turns out that CPLAtof() only accepts "." regardless
of locale. 

Also added this into GDALReadWorldFile() in gdal_misc.cpp, and also the
.tab reader and the RPC metadata reading. 

Also added a test for this functionality in autotest/gdrivers/png.py via
the new test.wld mixed locale file in data.

All changes are in trunk.  I'm considering backporting to 1.4.x.

comment:3 by warmerdam, 17 years ago

I have confirmed correct operation on windows, but attempts to merge have
been so far unsuccessful.  The changes are in:

 -r 10716:10712

Revisit tomorrow...

comment:6 by warmerdam, 17 years ago

Description: modified (diff)
Milestone: 1.4.1

comment:7 by warmerdam, 17 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.