Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
5.6.2
-
None
-
FreeBSD 12-CURRENT, Qt 5.6.2
Description
When using ICU, Qt may call ucnv_getDefaultName() without calling setlocale(.., "") first, which is required before calling ucnv_getDefaultName().
One such possible path is:
QString::fromLocal8Bit() -> QTextCodec::codecForLocale() -> QIcuCodec::defaultCodecUnlocked() -> ucnv_getDefaultName()
setlocale() is called in QCoreApplicationPrivate::initLocale(), which may not have been called.
A call to initLocale() should be added to QIcuCodec::defaultCodecUnlocked(). When not using ICU, initLocale() is called in setupLocaleMapper(), so it should also be done when using ICU, or the call can be moved into QTextCodec::codecForLocale().
A real problem appears when using Gwenview 16.11.90 from KDE5 on FreeBSD with locale set to zh_CN.UTF-8. It cannot display image files which have Chinese characters in their paths.
Attachments
For Gerrit Dashboard: QTBUG-57522 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
179394,1 | Fix the finding of the system locale prior to QCoreApplication | 5.8 | qt/qtbase | Status: ABANDONED | +1 | 0 |
179395,1 | Fix the finding of the system locale prior to QCoreApplication | 5.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |