Hi,

I no longer get errors after setting this var:

$ export LC_NUMERIC=C

So I'm guessing GVim is not successfully setting it in some
circumstances. I never get this error running the terminal vim, no
matter what my language preference is set to.

Here is my output from "locale" and "locale -a" immediately after
rebooting and selecting "Language: German" and "Keyboard: USA" on the
Ubuntu log in options. This is Ubuntu 9.10 as well, sorry for the
previous incorrect version.

[nra...@ubuntu:~]$ locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
[nra...@ubuntu:~]$ locale -a
C
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE.utf8
de_LI.utf8
de_LU.utf8
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX
[nra...@ubuntu:~]$

And for good measure, the ouput from "env"

[nra...@ubuntu:~]$ env
ORBIT_SOCKETDIR=/tmp/orbit-nraffo
SSH_AGENT_PID=1218
GPG_AGENT_INFO=/tmp/seahorse-GgVDhA/S.gpg-agent:1310:1
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=xxxxxxxxxxxxxxxxxxxxxxxxxx
GTK_RC_FILES=/etc/gtk/gtkrc:/home/nraffo/.gtkrc-1.2-gnome2
WINDOWID=46137347
GTK_MODULES=canberra-gtk-module
USER=nraffo
GNOME_KEYRING_SOCKET=/tmp/keyring-xWNTDH/socket
SSH_AUTH_SOCK=/tmp/keyring-xWNTDH/socket.ssh
SESSION_MANAGER=local/nraffo-laptop:@/tmp/.ICE-unix/1034,unix/nraffo-
laptop:/tmp/.ICE-unix/1034
USERNAME=nraffo
DESKTOP_SESSION=gnome
PATH=/home/nraffo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/
bin:/sbin:/bin:/usr/games
PWD=/home/nraffo
EDITOR=noo
GDM_KEYBOARD_LAYOUT=us
LANG=de_DE.UTF-8
GDM_LANG=de_DE.UTF-8
GDMSESSION=gnome
SPEECHD_PORT=7560
SHLVL=1
HOME=/home/nraffo
LANGUAGE=de_DE.UTF-8
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=nraffo
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-
P3ijeYIX6T,guid=xxxxxxxxxxxxxxxxxxxxxxxxxx
DISPLAY=:0.0
XAUTHORITY=/var/run/gdm/auth-for-nraffo-eWfmuJ/database
COLORTERM=gnome-terminal
_=/usr/bin/env




On Dec 6, 12:50 pm, Dominique Pellé <[email protected]> wrote:
> Nico wrote:
> > After receiving several bug reports from users in one of my scripts, I
> > came across this strange behavior. If GVim is being run in a different
> > language, most functions cannot be called with floating point numbers
> > as arguments. Here are the steps to reproduce:
>
> > file: test.vim ----------------------------------
>
> > function TestFloat(secret_number)
> >    echo a:secret_number
> > endfunction
>
> > call TestFloat(3.14)
>
> > -----------------------------------------------------
>
> >> export LANG=de_DE.utf-8
> >> gvim
>
> > :source test.vim
>
> > Produces:
>
> > E806: using Float as String
> > E116: Invalid arguments for function TestFloat
>
> > This test, and all my bug reports, have come running Ubuntu 9.04.
>
> > From :version ....
>
> > VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Dec  6 2009 10:55:12)
> > Included patches: 1-315
>
> Hi
>
> I tried to reproduce the bug but I couldn't. Your script prints
> "3.14" (as expected) regardless of the locale and does not
> give any error for me.
>
> I'm not sure but my guess is that it has to do with the fact that
> American English writes "3.14" whereas most European languages
> write "3,14" (comma instead of dot).
>
> Looking at Vim's code, I see that Vim calls setlocale(LC_NUMERIC, "C")
> to ensure that decimal is always a dot and not a comma (see
> init_locale() in main.c:1397) and it works fine for me on
> Ubuntu-9.10 using Vim-7.2.315 regardless of the language
> (French, Italian, ...). I'm not sure why it does not work for you.
>
> Can you try setting LC_NUMERIC before running Vim with...
>
> $ unset LC_ALL
> $ export LC_NUMERIC=C
> $ export LANG=de_DE.UTF-8
>
> Can you also give the output of the "locale" and "locale -a"
> commands?
>
> Regards
> -- Dominique

-- 
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui