|
From: Petr M. <mi...@ph...> - 2005-05-24 14:04:55
|
> > Cannot be .Xdefaults parsing locale-independent?
> That's not for us to decide, I think: we don't parse .Xdefaults
> ourselves, but rather have X11 API functions do that for us. Thus the
> problem, if any, is in X11.
No, it is in gnuplot -- gplt_x11.c:
if (sscanf(v, "%30[^,],%lf", color, &intensity) == 2) {
if (intensity < 0 || intensity > 1) {
fprintf(stderr, "\ngnuplot: invalid color intensity in '%s'\n", color);
intensity = 1;
}
} else {
strcpy(color, v);
intensity = 1;
}
It is the above sscanf() which returns different values according to locale.
Funny -- gnuplot ignores locale, gnuplot_x11 takes care about them:
sscanf("3,1415", "%lg", &x);
gives different results in command.c and gplt_x11.c.
It seems that this in gplt_x11.c
setlocale(LC_ALL, "")==NULL
is responsible for the problems.
Could locales be ignored when reading .Xdefaults?
---
PM
|