On Thu, 2010-02-04 at 17:30 +0000, [email protected] wrote:
> Peter Clifton sandte am 04.02.10 14:38 Uhr:
> > It isn't present in Ubuntu.
> >
> > I don't think this is something we'll be able to fix easily. I can't
> > find any setlocale() calls in the gtk-qt-engine source, so I presume it
> > is "somewhere" in QT which resets the locale based upon the environment
> > variables.
> >
> > I guess we "could" attempt to work around it by re-setting the
> > LC_NUMERIC environment variable when loading gschem, hopefully
> > discouraging QT from messing up the setting afterwards..
> >
> > Since this isn't a common use-case, so is unlikely to be a huge priority
> > to fix / work around. In the long term, I'd love to see gschem stop
> > relying on setting LC_NUMERIC in the first place.
>
> Nevermind, as I had included gtk-gt-engine by accident anyway.
> It is an peculiar error none the less. At least I now know how to circumvent
> the error, what makes gschem not totally unusable for me.
>
> Thanks!
Also, I'd appreciate knowing if either of these patches work (on their
own). The one I sent before was blank! Oops!
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 945b940..0c14af6 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -158,6 +158,8 @@ void main_prog(void *closure, int argc, char *argv[])
gtk_init(&argc, &argv);
+ setlocale(LC_NUMERIC, "C");
+
argv_index = parse_commandline(argc, argv);
cwd = g_get_current_dir();
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 945b940..a89dd83 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -146,6 +146,7 @@ void main_prog(void *closure, int argc, char *argv[])
/* This must be the same for all locales */
setlocale(LC_NUMERIC, "C");
+ putenv ("LC_NUMERIC=C");
/* Disable gtk's ability to set the locale. */
/* If gtk is allowed to set the locale, then it will override the */