public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] intl: Treat C.UTF-8 locale like C locale, part 2 (BZ# 16621)
Date: Tue, 12 Sep 2023 16:44:36 +0200	[thread overview]
Message-ID: <10272749.85pcf5A44T@nimes> (raw)
In-Reply-To: <87o7i92m0p.fsf@oldenburg.str.redhat.com>

Florian Weimer wrote:
> > The previous commit was incomplete: gettext() still returns a translation
> > if the file /usr/share/locale/C/LC_MESSAGES/<domain>.mo exists. This patch
> > prohibits the translation also in this case.
> 
> I wasn't sure if this is a bug.  The implementation does not fallback to
> translation, it just uses C as a message catalog.  Do you consider this
> a problem?

Yes, I consider this a bug, for two reasons:

* The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 states
  "It shall be the C locale but with UTF-8 encodings."
  and
  "These will be the same as C... LC_MESSAGES"

  The C locale has the property that gettext() returns the msgid in all cases,
  regardless of what files are on disk and regardless of the values of any
  environment variables.

  If the C.UTF-8 has the property that gettext() returns msgid only if there
  is no translation catalog at /usr/share/locale/C/LC_MESSAGES/<domain>.mo,
  it is *not* the same as "the C locale but with UTF-8 encodings".

* We have this rule, that gettext() returns the msgid when the locale is the
  "C" locale, because
     - the POSIX standard specifies the precise output of some programs (e.g.
       'diff') in the C locale, and
     - we wanted, from the beginning in 1995, that gettext() can be used in
       the source code of these programs, without an explicit check for the
       locale.
  It is possible that, in the long run, POSIX adopts the C.UTF-8 locale,
  since several platforms already have it: glibc, musl libc, FreeBSD, NetBSD,
  OpenBSD, Cygwin, Android.
  When this happens, we want that the maintainers of 'diff' etc. can continue
  to use gettext(), without introducing an explicit check for the locale.

Bruno




  reply	other threads:[~2023-09-12 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-10 19:17 Bruno Haible
2023-09-11  7:43 ` Florian Weimer
2023-09-12 14:44   ` Bruno Haible [this message]
2023-12-12  9:08 ` Florian Weimer

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

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

  git send-email \
    --in-reply-to=10272749.85pcf5A44T@nimes \
    --to=bruno@clisp.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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.
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).