Why does Qt reject a valid JSON? Why does Qt reject a valid JSON? json json

Why does Qt reject a valid JSON?


I have no idea of Qt, so I googled for a second. Here's what I found:

What you have is a string, a text representation. It's not the binary format Qt uses internally. The binary data would not be readable. QJsonDocument::fromBinaryData expects such a binary blob.

What you want to do seems to be achieved with QJsonDocument::fromJson which expects an UTF8-encoded Json string.


Instead of fromBinaryData use fromJson with the same argument, I had this exact problem yesterday and that was what worked for me.