NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

standards/54693: LC_TIME keywords violate POSIX



>Number:         54693
>Category:       standards
>Synopsis:       LC_TIME keywords violate POSIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 12 06:00:00 +0000 2019
>Originator:     AJ Jordan
>Release:        8.1
>Organization:
>Environment:
NetBSD localhost 8.1 NetBSD 8.1 (GENERIC) #0: Fri May 31 08:43:59 UTC 2019  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile GENERIC amd64
>Description:
IEEE Std 1003.1-2004 ("POSIX.1")[1] section 7.3.5.1 states:

> In a locale definition, the following mandatory keywords shall be recognized:
>
> [...]
>
> [abmon] Define the abbreviated month names, corresponding to the %b conversion specification. The operand shall consist of twelve semicolon-separated strings, each  surrounded by double-quotes. The first string shall be the abbreviated name of the first month of the year (January), the  second the abbreviated name of the second month, and so on.

However, it turns out that NetBSD does not conform to this behavior. `locale -k abmon` does not print anything. On the other hand, `locale -k abmon_1` _does_ return "Jan", and so on and so forth. There are similar problems with `mon` and maybe some other keywords (I haven't checked).

It seems to me that this is a bug and that the locale keywords need to be changed if NetBSD wants to conform to POSIX. Note that locale(1) claims to be conformant to POSIX.1.

I found this same bug in FreeBSD[3]; it was just recently fixed.

(For some context, I'm the maintainer of filter-other-days[2] and in the course of trying to figure out how to do localization support, I started using `locale -k` to extract this information from the system.)

 [1]: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1309815
 [2]: https://github.com/strugee/filter-other-days
 [3]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237752

>How-To-Repeat:
$ locale -k abmon
>Fix:



Home | Main Index | Thread Index | Old Index