IEEE Standards Interpretations for IEEE Std 1003.2™-1992 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)--Part 2: Shell and Utilities
Copyright © 1996 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department, Copyrights and Permissions, 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #145
Topic: locale -k Relevant Sections: 4.34.3, 22.214.171.124
The specification of locale -k seems unclear. On page 316 of POSIX.2 line 5453, the -k option is defined as: -k Write the names and values of selected keywords. ... where it is clearly defined what keywords are acceptable. However, it is NOT defined in the specification as to what form the values for those keywords should take. The only other mention is on page 318, where it describes the format the output for the locale -k option is to take, but also fails to describe where the value comes from. The definitions on page 60 (Table 2-9) indicates two possible values for the specified symbols, the localeconv() value and the localedef value. We can find no indication in the POSIX.2 specification defining which of these values or other possible implementation defined values are valid for the -k option for locale.
The most that the specification says about this is in Section 2.5.1: ".... The behaviour of standard utilities and functions in the POSIX locale is as if the locale was defined via the localedef utility with input data from Table... , all in 2.5.2" However, the specification for the localedef utility does not define the format or content of the output. It DOES talk about the input as specified in Section 2.5.2 , but not the output. (Example: acceptable values output from localedef of the localeconv() value is not denied by the specification). Further, the specification does not document nor does it discuss that a translation from localedef to locale should or should not happen. (e.g. the specification does not mandate that what goes into localedef, has to come out of locale). In particular, It appears as if locale may not necessarily report the same as what was input to localedef due to type changes (signed vs unsigned char). We believe that the failure of the specification to clearly define what values are acceptable to be returned to locale -k constitutes a grey area in the specification and as such no conformance distinction can be made based upon it.
We agree with the last paragraph of the interpretation request. The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this.
Rationale for Interpretation