git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions
Date: Fri, 13 Aug 2010 02:39:49 -0700 (PDT)	[thread overview]
Message-ID: <m3pqxm3l7k.fsf@localhost.localdomain> (raw)
In-Reply-To: <1281650895-7449-1-git-send-email-avarab@gmail.com>

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> 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

      reply	other threads:[~2010-08-13  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 22:08 [PATCH] gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions Ævar Arnfjörð Bjarmason
2010-08-13  9:39 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3pqxm3l7k.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).