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

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

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              matthias_rauter Matthias Rauter
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes