Issue 1108: grouping and mon_grouping questions

Authors: Jay Ghiron
Date: 2026-09-11
Submitted against: C23
Status: Open
Cross-references: 1107

The elements of grouping and mon_grouping are interpreted according to the following:

CHAR_MAX No further grouping is to be performed.
0 The 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.

Question 1

Can there be nonzero bytes after a CHAR_MAX? If so, are they meaningless?

Question 2

Can the first byte be CHAR_MAX? If so, is it equivalent to an empty string?

Question 3

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.

Question 4

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?

Question 5

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 "".