(doc?) locale-gen disagrees with locale(5)

Bug #1898902 reported by Hugo van der Sanden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GLibC
Unknown
Medium
glibc (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

The LC_NUMERIC section of locale(5) includes:

       decimal_point
              followed by the string that will be used as the decimal delim-
              iter when formatting numeric quantities.

.. without constraint on what the string may include. However locale-gen appears to reject any attempt to define decimal_point to a string longer than one character, with the message:
  LC_NUMERIC: value for field `decimal_point' must be a single character
  [error] LC_NUMERIC: field `decimal_point' not defined

If that constraint is intended, I think locale(5) should specify it. (There may be a similar issue for thousands_sep, I didn't test that.)

Found on bionic with locales-2.27-3ubuntu1.2, I did not check other releases.

Motivation: I wanted to define a longer decimal_point so as to test the robustness of an application's number formatting.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report. Looks like there is room for clarification of that man page.

I would suggest that you report it upstream:

https://sourceware.org/bugzilla/enter_bug.cgi?product=glibc;component=locale

But don't refer to locale-gen() when doing so, but rather localedef(). Also, if you file an upstream bug, please post the URL to it here.

Revision history for this message
In , Hugo van der Sanden (hugovds) wrote :

In the section for LC_NUMERIC, locale(5) says:

  decimal_point
    followed by the string that will be used as the decimal delim-
    iter when formatting numeric quantities.

.. without constraint on what the string may include. It appears this is actually constrained by processors to be a single character, as at https://code.woboq.org/userspace/glibc/locale/programs/ld-numeric.c.html#229

It is not clear if that is part of the spec: if so, I think this should be made explicit in the man page; if not, it is probably still worth noting that some applications (such as localedef) require it.

I have not checked, but it seems likely that thousands_sep has the same constraint, and would need similar treatment.

Initially reported for Ubuntu at https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1898902, they recommended I re-post upstream.

Revision history for this message
Hugo van der Sanden (hugovds) wrote :
Balint Reczey (rbalint)
Changed in glibc (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
Changed in glibc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Florian Weimer (fweimer) wrote :

The manual pages are maintained by the Linux man-pages project. I submitted a patch: https://<email address hidden>/T/

Revision history for this message
Florian Weimer (fweimer) wrote :

Please note that the manual pages come from the Linux man-pages project, not glibc. I posted a patch: https://<email address hidden>/T/

Changed in glibc:
status: New → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.