Date: Tue, 26 Aug 2025 21:06:22 -0700
On Tuesday, 26 August 2025 20:56:16 Pacific Daylight Time Tom Honermann wrote:
> The current hold up for charN_t support for std::format and friends is lack
> of locale support for charN_t. We have talked about a short term fix of
> making use of locale dependent features ill-formed so that we can at least
> provide minimal std::format support for charN_t. I don't know how
> problematic that might be.
I see. That would indeed be a problem, because locale-formatting of numbers is
indeed important for us. QString::arg() supports it, so a format-like
replacement needs too. You could use ICU as a source of locale information...
An alternative is for the standard formatters API to provide information about
the parsed template so we can format the number ourselves. This would be
welcome anyway, because right now the API requires us to parse the template
for our own string-like types which means subtle differences can be expected
(on the other hand, we don't care about string lengths and widths and probably
won't do aligning either).
> The current hold up for charN_t support for std::format and friends is lack
> of locale support for charN_t. We have talked about a short term fix of
> making use of locale dependent features ill-formed so that we can at least
> provide minimal std::format support for charN_t. I don't know how
> problematic that might be.
I see. That would indeed be a problem, because locale-formatting of numbers is
indeed important for us. QString::arg() supports it, so a format-like
replacement needs too. You could use ICU as a source of locale information...
An alternative is for the standard formatters API to provide information about
the parsed template so we can format the number ourselves. This would be
welcome anyway, because right now the API requires us to parse the template
for our own string-like types which means subtle differences can be expected
(on the other hand, we don't care about string lengths and widths and probably
won't do aligning either).
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Platform & System Engineering
Received on 2025-08-27 04:06:31