On 02/10/11 22:25, Bram Moolenaar wrote:

Tony Mechelynck wrote:

My gvim (7.3.329) is compiled with +float.
My environment contains
    $LANG=en_US.UTF-8
    $LANGUAGE=
    $LC_PAPER=en_GB
    $LC_TIME=en_GB
    no other $LC_something
My vimrc sets
    language messages C
    language time en_GB
But contrary to what is said in the help (currently at line 78 of
mlang.txt, one page or so below :help :lang), $LC_NUMERIC (as seen in
the output of :lang with no arguments) is not set at C, it remains at
en_US.UTF-8 (implicitly from $LANG I suppose).

In this case it doesn't matter since the decimal point for en_US is the
period. But I wonder what would have happened in a French locale (where
the "decimal-point is comma" convention is /de rigueur/).

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


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
192. Your boss asks you to "go fer" coffee and you come up with 235 FTP sites.

--
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

Raspunde prin e-mail lui