Merge branch 'kb/windows-force-utf8'
Windows update. * kb/windows-force-utf8: gettext: always use UTF-8 on native Windows
This commit is contained in:
commit
0328db0c2b
20
gettext.c
20
gettext.c
@ -12,7 +12,25 @@
|
||||
#ifndef NO_GETTEXT
|
||||
# include <locale.h>
|
||||
# include <libintl.h>
|
||||
# ifdef HAVE_LIBCHARSET_H
|
||||
# ifdef GIT_WINDOWS_NATIVE
|
||||
|
||||
static const char *locale_charset(void)
|
||||
{
|
||||
const char *env = getenv("LC_ALL"), *dot;
|
||||
|
||||
if (!env || !*env)
|
||||
env = getenv("LC_CTYPE");
|
||||
if (!env || !*env)
|
||||
env = getenv("LANG");
|
||||
|
||||
if (!env)
|
||||
return "UTF-8";
|
||||
|
||||
dot = strchr(env, '.');
|
||||
return !dot ? env : dot + 1;
|
||||
}
|
||||
|
||||
# elif defined HAVE_LIBCHARSET_H
|
||||
# include <libcharset.h>
|
||||
# else
|
||||
# include <langinfo.h>
|
||||
|
Loading…
Reference in New Issue
Block a user