[XForms] dot vs. comma (0.88 vs. 1.0.x)

Jens Thoms Toerring Jens.Toerring at physik.fu-berlin.de
Sun May 30 10:46:42 EDT 2004


Hi,

   for those still interested in the setlocale() etc. question here
some new observations:

On an older Linux machine (with 2.2.4 libc) setting the locale back
to "C" works as expected - i.e. if my LANG environment variable is
"de_DE" (for German, where a comma instead of a dot is used as the
decimal separator) I afterwards can use the dot in input and it gets
printed out in output.

With a newer Linux machine (libc 2.3.2) this doesn't work anymore.
Even after having the setlocale() call immediately after the call
of fl_initialize() does not help.

On both I am using XForms 1.0.0.

With a test program (not using XForms) I can correctly switch between
the locales.

On the newer Linux machine, when I switch the locale to "C" after
fl_initialize() it gets switched back to "de_DE" in the first
call of fl_show_form(). Up till now I couldn't figure out where
exactly this happens within fl_show_form.

Whatever the reasons I would strongly suggest to throw out all that
locale switching from XForms - messing around with this is really
annoying, especially since it hits you in unexpected places. Take
for example a command line program that reads in some double data.
This works perfectly well with data with a dot as decimal separator
since the start locale is always "C" when the program start. But
when you then add a GUI using XForms it suddenly breaks since XForms
believes it's more clever than the programmer and switches from "C"
to "de_DE". This is especially going to be a problem with programs
written by let's say an American (who usually doesn't even have to
be aware off all this because it always works with both the "C" and
the "en_US" locale) and which is then run by someone else in Germany,
with LANG set to "de_DE". Suddenly the program does not work anymore
for some completely mysterious reasons (it may be just some output
some cryptic error message like "Invalid data in input file".) Neither
the american programmer nor the german user will have any good clues
about what happens - the same file works perfectly well for the
american programmer and coming up with the explanation will take
lots of time and communication.
                                      Regards, Jens
-- 
  \   Jens Thoms Toerring  ___  Jens.Toerring at physik.fu-berlin.de
   \__________________________  http://www.toerring.de



More information about the Xforms mailing list