Title
Clarify the output encoding of `to_chars` for integers
Status
new
Section
[charconv.to.chars]
Submitter
Jan Schultke

Created on 2025-10-17.00:00:00 last changed 1 week ago

Messages

Date: 2025-10-23.11:14:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [charconv.to.chars] as indicated:

    constexpr to_chars_result to_chars(char* first, char* last, integer-type value, int base = 10);
    

    -4- Preconditions: `base` has a value between 2 and 36 (inclusive).

    -5- Effects: The value of `value` is converted to a string of digits in the given base (with no redundant leading zeroes) in the ordinary literal encoding ([lex.charset]). Digits in the range 10..35 (inclusive) are represented as lowercase characters 'a'..'z'. If `value` is less than zero, the representation starts with `'-'`.

Date: 2025-10-15.00:00:00

[ 2025-10-23; Reflector poll. ]

Set priority to 3 after reflector poll.

Concerns with meaning of `'a'..'z'` for EBCDIC. Suggestion to use `U+0061..U+007A` like in [tab:lex.charset.basic], as alternative.

Date: 2025-10-17.00:00:00

The integer overload of `to_chars` is specified "manually" rather than in terms of `printf`, and it is not clearly stated what encoding the output characters have. Given the existing use of the character literal `'-'` in the Effects element, the intent is presumably to output in the ordinary literal encoding.

History
Date User Action Args
2025-10-23 11:14:55adminsetmessages: + msg15385
2025-10-19 11:24:55adminsetmessages: + msg15264
2025-10-17 00:00:00admincreate