git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 13, 2010, 09:39 UTC
Message-ID
<m3pqxm3l7k.fsf@localhost.localdomain>
In-Reply-To
<1281650895-7449-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 15 quoted lines
> 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
Previous: Ævar Arnfjörð Bjarmason
Message 2 of 2 in “gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions”
  1. gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptionsÆvar Arnfjörð Bjarmason, Aug 12, 2010
  2. Jakub NarebskiAug 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.