After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 115409 - gnumeric non-functional in locale de_DE
gnumeric non-functional in locale de_DE
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other Linux
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2003-06-17 21:50 UTC by Andreas J. Guelzow
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2003-06-17 21:50:27 UTC
The summary may overstate the problem slightly but:

locale de_DE

enter 123,45 in A1, result: 123,00  What happened to the decimals?
enter =123.45 in A2, warning: Mehrfache Ausdrücke werden in diesem
Zusammenhang nicht unterstützt (Multiple expressions are not supported in
this context)

apparently the decimal separator (comma) is not correctly parsed.
Comment 1 Morten Welinder 2003-06-18 00:29:27 UTC
Is this before or after the extra format.c fix?

If after, you need to figure out why the locale's decimal separator
gets set to ".".
Comment 2 Andreas J. Guelzow 2003-06-18 00:41:52 UTC
After reading the /topic I updated my tree and the format.c file
jumped by 2 versions. So I suppose I got the latest fix.

And it didn't help.

I agree we need to figure out why the LC_NUMERIC are set to C rather
than de_DE as all the others. 
Comment 3 Andreas J. Guelzow 2003-06-18 02:15:03 UTC
the culprit seems to be gnome_print_config_default
Comment 4 Andreas J. Guelzow 2003-06-18 02:38:37 UTC
and the 2 potential setlocale calls are:

  • #0 setlocale
    from /lib/libc.so.6
  • #1 ppdOpen
    from /usr/lib/libcups.so.2
  • #2 ppdOpenFile
    from /usr/lib/libcups.so.2
  • #3 _init
    from /usr/lib/libgnomeprint/2.2.1.2/modules/libgnomeprintcups.so
  • #4 _init
    from /usr/lib/libgnomeprint/2.2.1.2/modules/libgnomeprintcups.so

Comment 5 Andreas J. Guelzow 2003-06-18 05:35:07 UTC
The first setlocale call in ppdOpen sets the decimal_point to . and
the second does not revert that change. As far as I can tell from the
libcups source, the LC_NUMERIC (or LC_ALL based on a env var) is et to
`C' and hen reset to the original. Apparently that is not happening
correctly.
Comment 6 Andreas J. Guelzow 2003-06-18 06:21:08 UTC
I would have thought that

char *oldlocale;

oldlocale = setlocale(LC_NUMERIC, NULL);

do stuff

setlocale(LC_NUMERIC, oldlocale);

would preserve the locale. (That is what they do in ppdOpen().)  I
tturns out that if we wrap this around the call to
gnome_print_config_default the oldlocale string changes in between the
two calls to setlocale. So that does not work. We would need to:

char *oldlocale;

oldlocale = g_strdup(setlocale(LC_NUMERIC, NULL));

do stuff

setlocale(LC_NUMERIC, oldlocale);
g_free (oldlocale);
Comment 7 Andreas J. Guelzow 2003-06-18 06:39:14 UTC
fixed by preserving the locale across the call to
gnome_print_config_default

I'll try to file a bug with libcups.