[Caml-list] Re: postscript, printf module and coma separator.

Jacques Garrigue garrigue at kurims.kyoto-u.ac.jp
Tue Jul 3 11:25:16 CEST 2001


> > Sorry for the very slow answer.
> > No, I don't believe that LablGTK does anything wrong: you have to call
> > setlocale if you want to make possible any internationalization of
> > your application, including fonts. In theory setting LC_NUMERIC to C
> > should be enough to solve the problem, but this can be hairy.
> > 
> > For hard cases, the last snapshot of lablgtk (2001-05-23) adds a
> > ?nolocale option to GMain.Main.init, which you can use as a quick hack
> > to disable the call to setlocale.
> 
> Note, i tried setting LANG to "" empty before doing the writting, but this
> didn't work, i don't understand why. I guess it is because the env var will
> only be taken in account at app launch time ?

You should call setlocale everytime you change it.

> I will try the nolocale option, but maybe a wrapping of the Printf &
> co module would be nice,

For me this is clearly a bug in Caml: code should not break because
you call setlocale somewhere. But well, I am starting to think that
reverting the default to not calling setlocale might be reasonable,
since this seems to be a real pain for French users.
(Turning it off by default will be a pain for Japanese users, since
they need it on to print anything...)

> In any case, we should have the same behavior that ocaml, this is very
> confusing when it is not so.

Well, yes. Part of the culprit is also the habit of setting LC_ALL,
meaning that even if you set LC_NUMERIC to C it will be ignored.

unset LC_ALL
export LC_NUMERIC=C
export LANG=fr_FR

and everybody should be happy...

Jacques



More information about the Lablgtk-list mailing list