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
