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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest