From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: printf doesn't respect locale
Date: Mon, 9 Sep 2019 13:55:56 -0400 [thread overview]
Message-ID: <20190909175556.GP9017@brightrain.aerifal.cx> (raw)
In-Reply-To: <20190909165100.GH22009@port70.net>
On Mon, Sep 09, 2019 at 06:51:00PM +0200, Szabolcs Nagy wrote:
> * Daniel Schoepe <daniel@schoepe.org> [2019-09-09 17:31:01 +0100]:
> > I think I found a discrepancy between musl's behavior and the POSIX standard:
> >
> > According to the POSIX standard, the decimal separator used when using
> > printf to print floating point numbers should come from the locale
> > (https://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html):
> >
> > "The radix character is defined in the current locale (category
> > LC_NUMERIC). In the POSIX locale, or in a locale where the radix
> > character is not defined, the radix character shall default to a
> > <period> ( '.' )."
> >
> > However, it seems that in musl, a period is always used for printing
> > floating point numbers. For example, the following program prints
> > "12.0" instead of "12,0" (which is printed when using GNU libc):
>
> musl is posix conform.
>
> it just only supports LC_NUMERIC locales where the radix
> character is a period.
>
> if you see a musl based system where LC_NUMERIC is defined
> otherwise then report the issue to the integrator or
> distributor of that system.
I don't understand what that would mean. musl's locale definition
system simply has no way to represent different radix point
characters, so there cant' be such an integration/distribution.
Rich
next prev parent reply other threads:[~2019-09-09 17:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 16:31 Daniel Schoepe
2019-09-09 16:39 ` Daniel Schoepe
2019-09-09 16:51 ` Szabolcs Nagy
2019-09-09 17:55 ` Rich Felker [this message]
2019-09-09 17:54 ` Rich Felker
2019-09-10 16:00 ` Daniel Schoepe
2019-09-10 16:31 ` Szabolcs Nagy
2019-09-10 16:44 ` Tim Tassonis
2019-09-10 17:30 ` Rich Felker
2019-09-10 17:10 ` Daniel Schoepe
2019-09-10 17:33 ` Rich Felker
2019-09-10 18:43 ` Szabolcs Nagy
2019-09-10 21:55 ` A. Wilcox
2019-09-11 10:01 ` Szabolcs Nagy
2019-09-11 10:07 ` Jens Gustedt
2019-09-11 11:44 ` Rich Felker
2019-09-11 12:53 ` Jens Gustedt
2019-09-11 13:47 ` Rich Felker
2019-09-11 15:15 ` Jens Gustedt
2019-09-11 15:38 ` Rich Felker
2019-09-11 18:08 ` Jens Gustedt
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=20190909175556.GP9017@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.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://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).