NetBSD Problem Report #54693

From www@netbsd.org  Tue Nov 12 05:57:43 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CF1B67A181
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 12 Nov 2019 05:57:43 +0000 (UTC)
Message-Id: <20191112055742.9B23B7A242@mollari.NetBSD.org>
Date: Tue, 12 Nov 2019 05:57:42 +0000 (UTC)
From: alex@strugee.net
Reply-To: alex@strugee.net
To: gnats-bugs@NetBSD.org
Subject: LC_TIME keywords violate POSIX
X-Send-Pr-Version: www-1.0

>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:/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:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.