Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26003

"Escape String Literal as UTF-8" creates illegal code

    XMLWordPrintable

Details

    • b152f3ace844effa64c4f970106edec864cbb052 (qt-creator/qt-creator/5.0)

    Description

      In C/C++ a \x escape sequence is "unbounded" (unlike other programming languages).

      "\x123456" isn't "\x12" followed by "3456", it's the character 0x123456 (which likely is out of range).

       

      This causes a bug with the UTF-8 quickfix:

          const QString str = "à123"; 

       

      Get quick fixed to

          const QString str = "\xc3\xa0123"; 

       

      Which is illegal/wrong.

       

      It should be instead

       const QString str = "\xc3\xa0""123";  

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes