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

qstring equality fails to match on different utf8 representations of the same character

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      short explanation:

      qstring fails to recognise different unicode/utf8 representations of the same character as equivalents.

      steps to reproduce:

      1. start qt creator
      2. create a new qt console application project (mine uses cmake, but it shouldn't really matter)
      3. try to compile in as-is to make sure you can compile
      4. close qt creator
      5. overwrite main.cpp inside this dummy project with the attached file
      6. reopen qt creator
      7. reopen the project
      8. build
      9. run

      actual stderr output:

      "ö" "ö" "ö" "ö"
      this one is false but should be true
      this one is false but should be true
      true
      true
      ok so even the pointers are the same, no strcmp needed
      yes, these byte sequeces are expected to differ
      

      expected result:

      "ö" "ö" "ö" "ö"
      this one is true but should be true
      this one is true but should be true
      true
      true
      ok so even the pointers are the same, no strcmp needed
      yes, these byte sequeces are expected to differ
      

      also, a22.length() is 2, it should be 1.

      if I ctrl-f for one of them in gedit, it finds both of them, which suggests that they are actually different representations of the same character.

      Thank you for the fix in advance.

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            imre Imre Péntek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes