#include "git-compat-util.h"
#include "abspath.h"
#include "environment.h"
#include "exec-cmd.h"
#include "gettext.h"
#include "utf8.h"
#ifndef NO_GETTEXT
# include <libintl.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>
#define locale_charset() …
# endif
#endif
static const char *charset;
const char *get_preferred_languages(void)
{ … }
#ifndef NO_GETTEXT
__attribute__((format (printf, 1, 2)))
static int test_vsnprintf(const char *fmt, ...)
{ … }
static void init_gettext_charset(const char *domain)
{ … }
int git_gettext_enabled = …;
void git_setup_gettext(void)
{ … }
int gettext_width(const char *s)
{ … }
#endif
int is_utf8_locale(void)
{ … }