grouping and mon_grouping questionsAuthors: Jay Ghiron
Date: 2026-09-11
Submitted against: C23
Status: Open
Cross-references: 1107
The elements of
groupingandmon_groupingare interpreted according to the following:
CHAR_MAXNo further grouping is to be performed. 0The previous element is to be repeatedly used for the remainder of the digits. other The integer value is the number of digits that compose the current group. The next element is examined to determine the size of the next group of digits before the current group.
(C23 7.11.3.1 "The localeconv function" paragraph 4.)
All of the following questions are about grouping and
mon_grouping. Some questions discuss possibilities that should
perhaps be forbidden.
Can there be nonzero bytes after a CHAR_MAX? If so, are they
meaningless?
Can the first byte be CHAR_MAX? If so, is it equivalent to an empty
string?
For an empty string, what does it mean to repeat the previous element? An empty string can indicate that the field is of zero length, so it appears that the previously quoted text might still need to be considered.
What does it mean if grouping or mon_grouping has a first byte
that is not zero and not CHAR_MAX, while thousands_sep or
mon_thousands_sep respectively points to ""? Should it separate
with nothing as requested, or perhaps use a placeholder such as a
comma?
Can thousands_sep and mon_thousands_sep point to something other
than "" if grouping and mon_grouping respectively have first
bytes that are zero or CHAR_MAX?
See also issue 1107 which discusses whether or not a
string composed entirely of shift sequences that in combination
preserve the initial shift state counts as pointing to "".