MCPcopy Create free account
hub / github.com/git/git / locale_charset

Function locale_charset

gettext.c:18–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16# ifdef GIT_WINDOWS_NATIVE
17
18static const char *locale_charset(void)
19{
20 const char *env = getenv("LC_ALL"), *dot;
21
22 if (!env || !*env)
23 env = getenv("LC_CTYPE");
24 if (!env || !*env)
25 env = getenv("LANG");
26
27 if (!env)
28 return "UTF-8";
29
30 dot = strchr(env, '.');
31 return !dot ? env : dot + 1;
32}
33
34# elif defined HAVE_LIBCHARSET_H
35# include <libcharset.h>

Callers 1

init_gettext_charsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected