Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.0
-
None
-
-
0d55d1c640eff6b1bb9fcfa8f9130635782e0c97 (qt/qtbase/dev) 764205577b5464ed01cc66bded9743dd59531217 (qt/qtbase/5.15)
Description
From: https://doc.qt.io/qt-5/qcborvalue.html#toJsonValue
It appears that ANY QByteArray data ends up base64 encoded (even simple strings like "hello"). The documentation makes it sound like it's lossless, which it is, but use of that word, coupled with the "an encoding like base64" is vague and makes the reader think if they put in simple ascii "hello" they get back "hello" and not some crazy "qq1234qw" base64 string.
Suggest making the documentation for QCBorValue more explicit as well as the QJsonDocument documentation to tell users what to expect if they stick QByteArrays into their QCBors or QVariants and then serialize to JSON. Going from "hello" -> crazy base64 string is not what most developers would expect.