From: Jakub Narebski Date: Fri, 13 Aug 2010 09:39:49 GMT Subject: Re: [PATCH] gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions Message-ID: In-Reply-To: <1281650895-7449-1-git-send-email-avarab@gmail.com> Ævar Arnfjörð Bjarmason writes: > Remove the setlocale/LC_CTYPE call from gettext.c, we only need > setlocale/LC_MESSAGES to use the message catalog, and setting LC_CTYPE > from the environment breaks Git's assumptions about C library > functions. > > Under a non-C locale functions like vsnprintf become locale sensitive, > so that they'll e.g. refuse to process ISO-8895-1 data under a UTF-8 > locale. > > This triggered a "your vsnprintf is broken" error on Git's own > repository when inspecting v0.99.6~1 under a UTF-8 locale. > > That commit contains a ISO-8859-1 encoded author name, which the > locale aware vsnprintf(3) won't interpolate in the format argument, > due to mismatch between the data encoding and the locale. Sidenote: This commit was done probably before invention of 'encoding' header, but it should be displayable anyway. -- Jakub Narebski Poland ShadeHawk on #git