From d3b9944e10860fe322b2c21ce0d00a733aa977dc Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Thu, 9 Apr 2015 16:19:56 +0100 Subject: [PATCH] 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 --- gettext.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gettext.c b/gettext.c index 8b2da4641f..3741025812 100644 --- a/gettext.c +++ b/gettext.c @@ -12,6 +12,8 @@ # include # ifdef HAVE_LIBCHARSET_H # include +# elif defined GIT_WINDOWS_NATIVE +# define locale_charset() "UTF-8" # else # include # define locale_charset() nl_langinfo(CODESET)