[Development] char8_t summary?

Matthew Woehlke mwoehlke.floss at gmail.com
Thu Jul 11 00:26:10 CEST 2019

On 10/07/2019 09.10, Mutz, Marc via Development wrote:
> The other reason is about error checking: What should the result be of
> putting an æ into a QAsciiString? Assert at runtime? UB? In
> QLatin1String, this error just can't happen. Even if you feed it UTF-8,
> you may get mojibake, because you picked the wrong encoding, but it's
> not an error. Any UTF-8 octet sequence is a valid L1 string.
> So, I don't see QAscii* pulling it's weight.

The reason ASCII might be helpful is that it guarantees certain
transformations (e.g. case conversion) in-place. L1 can't do this; the
L1 upper-case of U+00DF ('ß') is "SS". U+00FF ('ÿ') is in a similar
boat; I'm not sure it *has* an L1 upper-case. (The "proper" upper-case
is, I presume, U+0178, which is not in L1.)

Also, conversion from ASCII to either L1 or UTF-8 is a no-op. (ASCII to
UTF-16 can also be done with strict widening, but that's true for L1 also.)


More information about the Development mailing list