Been doing quite a lot of work with Qt and it just hit me, which one should I use to convert my QStrings to QByteArray and back? And there is some other issues where I dont know what to do exactly.
For example when dealing with QUrl. I have an object where on of the members are a QString and I'm setting it like this:
blobByType->setBlobAbsoluteUri(request.url().toEncoded()); The toEncoded() converts it to utf8 and and all non-ASCII characters are then percent encode. When I then set the QString to a QByteArray it automatically converts it Ascii.
Also, when doing most of my converting from QString to QByteArray I currently use toUtf8().
My question is, what should I use when converting from QString to QByteArray and vice versa?
QByteArrayfor, or what kind of strings you intend to store in it.