mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
Merge pull request #9362 from bfredl/macnumlocale
os/lang: use the correct LC_NUMERIC also for OS X
This commit is contained in:
commit
aec096fc5b
@ -54,6 +54,11 @@ void lang_init(void)
|
|||||||
CFRelease(cf_lang_region);
|
CFRelease(cf_lang_region);
|
||||||
# ifdef HAVE_LOCALE_H
|
# ifdef HAVE_LOCALE_H
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
|
# ifdef LC_NUMERIC
|
||||||
|
// Make sure strtod() uses a decimal point, not a comma.
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,4 +18,13 @@ describe('viml', function()
|
|||||||
]])
|
]])
|
||||||
eq(nil, string.find(eval('v:errmsg'), '^E129'))
|
eq(nil, string.find(eval('v:errmsg'), '^E129'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('str2float is not affected by locale', function()
|
||||||
|
if exc_exec('lang ctype sv_SE.UTF-8') ~= 0 then
|
||||||
|
pending("Locale sv_SE.UTF-8 not supported")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
clear{env={LANG="", LC_NUMERIC="sv_SE.UTF-8"}}
|
||||||
|
eq(2.2, eval('str2float("2.2")'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user