[Qt-interest] Displaying unicode strings

Andre Somers andre at familiesomers.nl
Sat Aug 28 20:28:49 CEST 2010


  Op 28-8-2010 18:51, Eeli Reilin schreef:
>> How was the JSON data parsed into strings?
> The data comes from the QNetworkReply::readAll() as a QByteArray, and is
> then used to construct a QString. The data is parsed into strings using
> the QString::mid method among other things. So the the strings are
> actually just substrings of the actual JSON string.
A QByteArray is not a string. It is just a bunch of bytes. To get from 
that to a string that makes sense, you need to know how that string is 
encoded. So, *how* are your strings encoded? And are you using method 
calls that convey that encoding to so the byte array can be properly 
interpreted as a string?

André



More information about the Qt-interest-old mailing list