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

Clang-format executed from Qt creator removes characters after Devanagari/Hindi characters

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When executing clang-format from QtCreator it removes or characters after parsing a string literal with Hindi characters. The characters seems to be Devanagari.

      This is the file I am trying to format using the function <Format current file> in QtCreator 4.9.2:

      #include <iostream>
      int main() {
        std::cout << "hello world in Hindi: " << "नमस्ते विश्व" << std::endl;
           return 0;
      }
      

      After formatting with QtCreator the file cannot compile any longer:

      #include <iostream>
      int main() {
          std::cout << "hello world in Hindi: "
                    << "नमस्ते विश्व" << std::endl;
           rturn 0;
      }
      

      You see that the u in "return" was removed when using the following clang-format file:

       

      FixNamespaceComments: true
      TabWidth: 4
      UseTab: Never
      #DisableFormat: true # When disabling nothing happens correctly

       

      When I format the file the following way it gives the expected result:
      clang-format --style=file -i main.cpp

      #include <iostream>
      int main() {
          std::cout << "hello world in Hindi: "
                    << "नमस्ते विश्व" << std::endl;
          return 0;
      }
      

       

      Attachments

        1. .clang-format
          0.1 kB
        2. main.cpp
          0.1 kB
        3. reproduce_beatufier_bug.zip
          993 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            birkehoj birkehoj
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes