[Interest] Converting std::string.c_str() code to use QString methods

Syam syamcr at gmail.com
Sat Aug 31 04:47:48 CEST 2013


On 31-Aug-2013 6:28 AM, "Thiago Macieira" <thiago.macieira at intel.com> wrote:
>
> On sexta-feira, 30 de agosto de 2013 19:17:58, Scott Aron Bloom wrote:
> > I use toUtf8()... Though it wouldn't surprise me if Thiago scolds me
for it
>
> If you're on Unix, that's fine. It's fine because if your Unix system
uses a
> locale different from UTF-8, you *really* should be scolded :-)

On Linux, whenever I need a const char* from a QString, I always do
toLatin1().constData().

Earlier I used toAscii(), but then some discussion on Qt5 suggested that
toLatin1() is more appropriate.

Am I right here? Of course, the assumption is that the original QString is
simple English text.

Syam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130830/9afb1a02/attachment.html>


More information about the Interest mailing list