]> git.ipfire.org Git - thirdparty/git.git/commit - gettext.h
gettext: add is_utf8_locale()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 25 Jun 2016 05:22:34 +0000 (07:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jul 2016 19:44:57 +0000 (12:44 -0700)
commite8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b
treed9225aa23915b4aa0c0732adb0a01a18a8ee16cd
parent9d9babb84d45234132f3cb1f4527ce1106e3d2ec
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>
gettext.c
gettext.h