C++ Logo

sg16

Advanced search

Re: [isocpp-sg16] std::format and charN_t

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 28 Jun 2024 15:54:52 -0700
On Friday 28 June 2024 07:25:45 GMT-7 Corentin Jabot via SG16 wrote:
> I think getting consensus on what the the source encoding of that
> conversion to UTF-16 (or worse, the wide (execution?) encoding)
> is is going to be a bit more challenging. format has that dual nature of
> being text but also letting you
> inject arbitrary bytes in the output (which of course would be mojibake
> when converting, and that's fine but we need to find the design that
> minimizes mojibake).

std::format is for text. It has no arbitrary bytes.

If you want to output binary data, use write() functions on your device.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-06-28 22:54:54