Thiago had observed:
>>> Arguably, toUpper() and toLower() should be removed, since
>>>
>>>      QByteArray(u8"Résumé").toLower()
>>> is mojibake.

вс, 7 июл. 2019 г., 12:58 André Hartmann 
<[email protected]<mailto:[email protected]>>:
>> I vote against that. If you got the "raw" data from a device as
>> described above, you might want to do .toHex().toUpper() which is fully 
>> valid.

Konstantin Ritt (8 July 2019 04:26) replied:
> I'd argue against validity of the `ba.toHex().toUpper()` example, as
> it brings false impression that you're operating on a string, where in
> fact your intention is to re-code the binary data from one encoded
> form to another encoded form (ASCII in this case, and one would have
> to `QString::fromLatin1()` it explicitly to manipulate it further).
> From the other hand, `ba.toHex(Uppercase)` enforces the reader to
> treat it exactly like an uppercased hex (whatever that means), which
> is just another encoding form of the binary data.

My thought exactly: we can, at least, add this overload to toHex().
Historical baggage precludes removing (or deprecating) the traditional
path, but we can at least add the path that avoids use of a suspect API.

        Eddy.
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to