[Qt-interest] Displaying unicode strings
Thiago Macieira
thiago at kde.org
Sat Aug 28 22:15:14 CEST 2010
On Saturday 28. August 2010 20.28.49 Andre Somers wrote:
> 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?
Also note that \uXXXX is not part of any encoding. If you wish to parse that,
you have to do it yourself.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100828/ca7ed6e4/attachment.bin
More information about the Qt-interest-old
mailing list