C++ Logo

std-proposals

Advanced search

Re: [std-proposals] charN_t (was: TBAA and extended floating-point types)

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 31 Aug 2025 12:13:21 -0400
On Sun, Aug 31, 2025 at 10:54 AM Sebastian Wittmeier via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> A function could just forward a string to another function or to a platform API, without assuming any encoding.

Yes, it can. That function could also be implemented to assume that
the `char16_t` string is instead encoded in GB18030 rather than
UTF-16. Regardless of *how* the assumption is violated, it is
understood that a function can violate those assumptions.

But such an API should not be *standardized*. That is, the C++
standard *ought to* presume the encoding of strings using those
character types, and it should not introduce any functions that don't
abide by those rules.

The standard can't enforce compliance with reasonable coding
practices. But at least it can maintain those for itself.

Received on 2025-08-31 16:13:33