Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135825

QString::contains is inconsistent with QString::toUpper()/toLower().

XMLWordPrintable

      As found in QTBUG-103043:

      The following code fails for some strings with specific unicode characters, e.g. "Straße" and "\uFB03" (U+FB03 LATIN SMALL LIGATURE FFI):

      QString hayStack = u"dhwqdwqdwqjdwqhdl" + mixedCase + u"dsadasdads";
      QVERIFY(hayStack.contains(mixedCase.toUpper(), Qt::CaseInsensitive));
      

      The following code works for "\uFB03" but fails for "Straße":

      QVERIFY(mixedCase.normalized(QString::NormalizationForm_KC).compare(mixedCase.toUpper(), Qt::CaseInsensitive) == 0);
      

      This is similar to QTBUG-135301 but the Fix is probably more difficult since Boyer-More has to account for possible variations in string lengths.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cnn Qt Core & Network
            matthias_rauter Matthias Rauter
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes