Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6438 closed defect (fixed)

Mistake in the configuration HAVE_SETLOCALE

Reported by: alaindelplanque Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc: Bas Couwenberg


gdal configure doesn't set properly HAVE_SETLOCALE.

In :


should be replace by :


And in gdal/port/, missing :

/* Define to 1 if you have the `setlocale' function. */

This causes a bug in internal libjson. Without HAVE_SETLOCALE, locale isn't set properly, and geojson coordinates are truncated to int values.

This bug was first reported in qgis:

Change History (4)

comment:1 by Bas Couwenberg, 7 years ago

Cc: Bas Couwenberg added

comment:2 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

This issue only affects GDAL < 2 (with internal libjson). In GDAL 2, the internal libjson has been patched so that json_parse_double() uses GDAL CPLStrtod() that ignores the locale, and we want to avoid playing with setlocale() because it is not thread-safe.

However this ticket called 2 commits :

  • trunk r33877 "configure: remove useless AC_CHECK_FUNC(setlocale) (#6438)"
  • trunk r33878 "GeoJSON: use CPLThreadLocaleC with external libjson (#6438)"

comment:3 by Even Rouault, 7 years ago

trunk r33880 "Revert r33878: external libjson already does setlocale() stuff (#6438)"

comment:4 by alaindelplanque, 7 years ago

Thank. I have just built gdal dev (internal libjson) + qgis, it work fine.

Note: See TracTickets for help on using tickets.