Code review comment for lp:~unity-api-team/hud/lp-1288025

Revision history for this message
Pete Woods (pete-woods) wrote :

> > Also, just so you know, you can convert a QString to a C string using the
> > following:
> >
> > string.toUtf8().constData()
>
> Awesome! How bloody obvious. Silly me for not seeing that immediately ;-)

I think it all comes from them trying supporting UTF across platforms. You need a temporary object representing just some bytes.

IIRC:
* Windows uses UTF-16 by default => use std::wstring
* Linux and OSX use UTF-8 by default => use std::string.

This means you have a difficult choice if you're making an app you want to work on both platforms. So I would think this is why Trolltech made QString. Maybe things have changed since I gathered this information? I'd be happy to be wrong on this!

« Back to merge proposal