C++ Logo

sg16

Advanced search

Re: [SG16] Towards a better description of the execution encoding

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Tue, 2 Mar 2021 22:17:16 +0100
On 02/03/2021 21.46, Peter Brett wrote:
> I would like to know if there is consensus that producing mojibake is always a bug.

A bug in the user-written program or a bug in the implementation?

Yes to the former: The user has relied on something that wasn't
actually guaranteed by the standard, so you get what you get.
(Similar to complaining to the C++ committee about bad floating-point
accuracy of some implementation.)

Jens


> Peter
>
>> -----Original Message-----
>> From: SG16 <sg16-bounces_at_[hidden]> On Behalf Of Jens Maurer via SG16
>> Sent: 02 March 2021 20:45
>> To: sg16_at_[hidden]; Hubert Tong <hubert.reinterpretcast_at_[hidden]>
>> Cc: Jens Maurer <Jens.Maurer_at_[hidden]>; Corentin <corentin.jabot_at_[hidden]>
>> Subject: Re: [SG16] Towards a better description of the execution encoding
>>
>> EXTERNAL MAIL
>>
>>
>> On 02/03/2021 10.35, Corentin via SG16 wrote:
>>> My intent is to say " The standard assumes that all strings are
>> interpreted by local specific functions as being encoded by the execution
>> encoding and if that's not the case, you will get mojibake or any other
>> behavior that may be the result of your input not being interpreted
>> correctly"
>>
>> Why do we have to say anything here, beyond possibly clarifying the
>> locale-dependent functions such as isalpha that they're not talking
>> about a character set (or characters), but about an encoding of such?
>>
>> The fact that we've divorced the literal encoding from the execution
>> encoding is exactly because they are entirely unrelated, as sad as
>> that may be. "Unrelated" means no constraints, and we don't need to
>> spend text in the standard (beyond a note or two) specifying the
>> absence of restrictions.
>>
>> Any time the introduction of limited constraints was brought up here
>> in the past month, a real-world counterexample was quickly found,
>> where we'd shy away from making it non-conforming.
>>
>> Jens
>>
>> --
>> SG16 mailing list
>> SG16_at_[hidden]
>> https://urldefense.com/v3/__https://lists.isocpp.org/mailman/listinfo.cgi/sg
>> 16__;!!EHscmS1ygiU1lA!XR06PLcM-9I92I2-
>> gdzFqmYGmkxk9gD3N2SpU88VeYP9M3MDg21QInT21yWbgA$

Received on 2021-03-02 15:17:24