Tony Mechelynck wrote:
> > Vim does explicitly set LC_NUMERIC to "C". And that's what happens for
> > me. I can't guess why it's different for you.
> >
>
> Neither can I; but adding a few :echomsg commands shows the following:
>
> - $LC_NUMERIC is "C" on entry to the vimrc
> - it is still "C" while sourcing the last global after-plugin
> - it has become empty (and is listed as "en_US.UTF-8" in the output of
> :lang with no arguments) at the GUIEnter event in gvim with GTK2/Gnome2 GUI
> - it remains set to "C" if I run the same Vim executable in console mode.
>
> I suspect the line marked below with <----- at line 1467 of main.c but I
> don't know GTK well enough to be sure. Do you think it would be worth
> swapping the two ifdef blocks to see if it changes anything? (Not this
> second, I'm going to bed.)
>
> /*
> * Setup to use the current locale (for ctype() and many other things).
> */
> static void
> init_locale()
> {
> setlocale(LC_ALL, "");
>
> # ifdef FEAT_GUI_GTK
> /* Tell Gtk not to change our locale settings. */
> gtk_disable_setlocale(); <----- this line
> # endif
> # if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
> /* Make sure strtod() uses a decimal point, not a comma. */
> setlocale(LC_NUMERIC, "C");
> # endif
I hope you are not checking the $LC_NUMERIC environment variable, it is
only used when calling setlocale(), not by the library functions where
the value of the locale matters.
You need to use setlocale(LC_NUMERIC, NULL) to check the actual value.
--
Bumper sticker: Honk if you love peace and quiet.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php