diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2019-03-26 11:42:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 11:42:25 +0100 |
commit | 2d50bf349883958bff1bb584fb3ad5cb97990993 (patch) | |
tree | 1e087562124fbfcecc7d760575e0deb3b4662c6f /src/nvim/api/vim.c | |
parent | 3441423481b7b2e7f127555633b62220aeca500b (diff) | |
download | rneovim-2d50bf349883958bff1bb584fb3ad5cb97990993.tar.gz rneovim-2d50bf349883958bff1bb584fb3ad5cb97990993.tar.bz2 rneovim-2d50bf349883958bff1bb584fb3ad5cb97990993.zip |
mac: do not use libintl_setlocale() (#9789)
gettext contains libintl.h. That header file defines a macro that replaces
`setlocale` by `libintl_setlocale`. That function eventually calls the original
`setlocale()` from Apple's libc, but is known to make it fail.
Mac users with gettext from Homebrew can easily reproduce this:
#include <stdio.h>
#include <locale.h>
#include <libintl.h>
int main(void) {
setlocale(LC_ALL, "");
printf("locale: %s\n", setlocale(LC_CTYPE, NULL));
}
Compile and run it:
cc -I/usr/local/opt/gettext/include -L/usr/local/opt/gettext/lib -lintl -o test test.c && ./test
When $LC_CTYPE is set to a valid value like UTF-8, it should output:
locale: UTF-8
But it does not. It returns C anyway. Remove libintl.h and recompile and you get
the expected UTF-8.
Fixes https://github.com/neovim/neovim/issues/9787
Diffstat (limited to 'src/nvim/api/vim.c')
0 files changed, 0 insertions, 0 deletions