mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: "Pablo Correa Gómez" <pabloyoyoista@postmarketos.org>
Subject: Re: [musl] [PATCH 0/2] Support printing localized RADIXCHAR
Date: Sun, 17 Dec 2023 08:26:08 +0100	[thread overview]
Message-ID: <ZX6ikLLSL-RMe0zA@voyager> (raw)
In-Reply-To: <20231216231037.GG4163@brightrain.aerifal.cx>

Am Sat, Dec 16, 2023 at 06:10:37PM -0500 schrieb Rich Felker:
> This is a topic that's been controversial. I have always been against
> having variable radix character, but I've also been seeking input from
> users who want localized output whether the lack of this functionality
> is a serious problem that needs revisiting.
>

Speaking as a German, if output is mostly translated (because
LC_MESSAGES is at the discretion of gettext) but numbers have a '.' as
radix and are output with a precision of 3, it is disorienting and
requires re-reading every time. Because in the German locale, '.' is a
valid thousands separator (space and inch mark also being acceptable),
and the thousands grouping is just 3.

And if they're output with a different precision, it is still jarring at
least.

> Last time it was discussed, I believe my position was that, if we do
> this, it needs to be a 1-bit setting, where a locale necessarily has
> either '.' or ',' as the radix. No other values actually appear in
> real-world conventions, and on other implementations such as glibc,
> the allowance for arbitrary characters allows doing some ~nasty~ stuff
> with output and input processing. For example, you could define the
> radix character to be '1' or something that makes conversions fail to
> round-trip.
>

That is reasonable. Overgeneralization usually leads to bad code or
unforseen outcomes. This is also the case for file names, with just
recently a bug report being introduced against POSIX to disallow control
characters there. (Imagine someone setting '\r' as radix point).

Ciao,
Markus

  reply	other threads:[~2023-12-17  7:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16 19:36 Pablo Correa Gómez
2023-12-16 19:36 ` [musl] [PATCH 1/2] langinfo: add support for LC_NUMERIC translations Pablo Correa Gómez
2023-12-16 19:36 ` [musl] [PATCH 2/2] printf: translate RADIXCHAR for floating-point numbers Pablo Correa Gómez
2023-12-16 23:10 ` [musl] [PATCH 0/2] Support printing localized RADIXCHAR Rich Felker
2023-12-17  7:26   ` Markus Wichmann [this message]
2023-12-17 22:25   ` Pablo Correa Gomez

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=ZX6ikLLSL-RMe0zA@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    --cc=pabloyoyoista@postmarketos.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).