summaryrefslogtreecommitdiff
path: root/gettext.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-25 05:22:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-01 19:44:57 (GMT)
commite8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b (patch)
treed9225aa23915b4aa0c0732adb0a01a18a8ee16cd /gettext.h
parent9d9babb84d45234132f3cb1f4527ce1106e3d2ec (diff)
downloadgit-e8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b.zip
git-e8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b.tar.gz
git-e8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b.tar.bz2
gettext: add is_utf8_locale()
This function returns true if git is running under an UTF-8 locale. pcre in the next patch will need this. is_encoding_utf8() is used instead of strcmp() to catch both "utf-8" and "utf8" suffixes. When built with no gettext support, we peek in several env variables to detect UTF-8. pcre library might support utf-8 even if libc is built without locale support.. The peeking code is a copy from compat/regex/regcomp.c Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gettext.h')
-rw-r--r--gettext.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gettext.h b/gettext.h
index 33696a4..7eee64a 100644
--- a/gettext.h
+++ b/gettext.h
@@ -90,5 +90,6 @@ const char *Q_(const char *msgid, const char *plu, unsigned long n)
#endif
const char *get_preferred_languages(void);
+extern int is_utf8_locale(void);
#endif