[Interest] Porting to Qt5/macx-xcode Mountain Lion

Thiago Macieira thiago.macieira at intel.com
Fri Jan 25 00:21:48 CET 2013


On quinta-feira, 24 de janeiro de 2013 14.51.24, Joshua Grauman wrote:
> Sorry for all the emails, but I finally tracked it down.
> QTextCodec::codecForName("UTF-8") is returning 0 because I call it before
> QApplication is initialized. I'm not sure if this is expected behavior or
> not. In any case, on the other platforms it's not a problem.

It's definitely a bug. Please remember that most Qt API is not supported before 
the QCoreApplication object is initialized, so this bug will have a low 
priority of fixing.

> But where there is definitely a bug in Qt is that
> QTextCodec::codecForName("UTF-8") caches the results, even when it returns
> 0. So my early call of QTextCodec::codecForName("UTF-8") gets a 0 cached
> for UTF-8, which then later causes QTextStream::readLine() to crash when
> it calls QTextCodec::codecForName("UTF-8"). So looking at the Qt code, an
> extra condition should be added to make sure null pointers aren't cached
> in the QTextCodec::codecForName() function. Thanks!

Indeed. The ICU-based codec system has a cache.

However, at first glance, I don't see anything that would cause the lookup to 
fail before QCoreApplication.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130124/afffac79/attachment.sig>


More information about the Interest mailing list