Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
4.4.1
-
None
Description
This causes the case insensitive indexOf function to not work correctly for unicode characters.
#include <QtGui> int main() { enum { Count = 2 }; const QChar chars[Count] = { QChar('E'), QChar(1025) }; for (int i=0; i<Count; ++i) { const QChar &unicode = chars[i]; const QChar folded = unicode.toCaseFolded(); const QChar foldedTwice = folded.toCaseFolded(); qDebug() << "haystack" << unicode.unicode() << "haystack folded" << folded.unicode() << "haystack folded twice" << foldedTwice.unicode(); const QString needle = unicode; const QString hayStack = needle.toLower(); qDebug() << "found needle" << hayStack.indexOf(needle, 0, Qt::CaseInsensitive) << "should be the same" << hayStack.toLower().indexOf(needle.toLower()); } return 0; }