gettext: always use UTF-8 on native Windows

Git on native Windows exclusively uses UTF-8 for console output (both with
mintty and native console windows). Gettext uses setlocale() to determine
the output encoding for translated text, however, MSVCRT's setlocale()
doesn't support UTF-8. As a result, translated text is encoded in system
encoding (GetAPC()), and non-ASCII chars are mangled in console output.

Use gettext's bind_textdomain_codeset() to force the encoding to UTF-8 on
native Windows.

Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
Karsten Blees
2015-04-09 16:19:56 +01:00
parent ebc298daac
commit d3b9944e10

View File

@@ -12,6 +12,8 @@
# include <libintl.h>
# ifdef HAVE_LIBCHARSET_H
# include <libcharset.h>
# elif defined GIT_WINDOWS_NATIVE
# define locale_charset() "UTF-8"
# else
# include <langinfo.h>
# define locale_charset() nl_langinfo(CODESET)