[GRASS5] [bug #3591] (grass) d.vect.thematic (and other scripts): LC_NUMERIC setting not used in my Debian

Glynn Clements glynn at gclements.plus.com
Wed Aug 31 16:00:17 EDT 2005

Moritz Lennert wrote:

> >>this bug's URL: http://intevation.de/rt/webrt?serial_num=3591
> >>-------------------------------------------------------------------------
> >>
> >>Subject: d.vect.thematic (and other scripts): LC_NUMERIC setting not
> >>used in my Debian
> > 
> > 
> > GRASS doesn't use any of the locale categories except for LC_MESSAGES
> > (if it was built using --with-nls).

Actually, I've just noticed that it also uses LC_CTYPE (again, only if
built using --with-nls):

	revision 1.8
	date: 2004/08/27 11:16:51;  author: markus;  state: Exp;  lines: +1 -0
	added LC_TYPE for japanese

This looks pretty dubious, as it changes the behaviour of many of the
<ctype.h> functions (isalpha(), tolower() etc) as well as
strcasecmp(), but GRASS' built-in string handling always assumes ASCII
(e.g. G_strcasecmp() only considers A-Z/a-z regardless of the locale).

> mlennert at moritz:~/CVS/GRASS/grass6/scripts$ grep -R LC_NUMERIC *
> d.correlate/d.correlate:export LC_NUMERIC=C
> d.out.png/d.out.png:export LC_NUMERIC=C
> d.resize/d.resize:export LC_NUMERIC=C
> d.vect.thematic/d.vect.thematic:export LC_NUMERIC=C
> i.fusion.brovey/i.fusion.brovey:export LC_NUMERIC=C


> So it is used quite a lot in scripts.

In all cases, it's forced to "C", which is the same as it not being
used. Scripts do this to prevent other programs (e.g. awk) from using
the user's LC_NUMERIC settings, so that they don't end up passing
floating-point values which use a comma to programs which expect a

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list