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

[Regression 6.5.3 -> 6.5.4/6.6.1]UTF-8 .pro file is not parsed correctly if system encoding is SHIFT-JIS

    XMLWordPrintable

Details

    • Windows
    • 4cd5024ebf88cdd5b08031e84aec6011e037b78a (6.5.5), 01a86e3e3da3ac9e771007b830597860829e8aff (6.6.3)

    Description

      Reproducer (encoding_test.zip) attached. The content of project "UTF-8" and "SHIFT-JIS" are the same (although project content is irrelevant in this case, just to keep everything simple). The point is that the .pro file is encoded by UTF-8 and SHIFT-JIS, respectively. Build the sample with MinGW kit.

      If system locale is "Japanese (Japan)", i.e. executing "chcp" in CMD outputs "932", then:
      1. With 6.5.3, both UTF-8 and SHIFT-JIS build well.
      2. With 6.5.4/6.6.1, UTF-8 fails to build due to error "undefined reference to `qMain(int, char**)". SHIFT-JIS builds well.

      So it feels like a regression that something worked with 6.5.3 stops working in new versions. The detailed log when "undefined reference to `qMain(int, char**)" happens is attached (config.txt). The reason of error is revealed by the following lines:

      DEBUG 1: visiting file C:/YoneQt/simplest_proj/simplest_proj/original_proj_simplified/rcu1100.pro
      DEBUG 1: C:/YoneQt/simplest_proj/simplest_proj/original_proj_simplified/rcu1100.pro: entering block
      DEBUG 1: C:/YoneQt/simplest_proj/simplest_proj/original_proj_simplified/rcu1100.pro:1: condition "?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" is false
      DEBUG 1: C:/YoneQt/simplest_proj/simplest_proj/original_proj_simplified/rcu1100.pro:1: leaving block, okey=false
      DEBUG 1: done visiting file C:/YoneQt/simplest_proj/simplest_proj/original_proj_simplified/rcu1100.pro
      

      That is, .pro file is not parsed correctly, and of course no entry point is available. And I think it is due to

      MultiByteToWideChar: Cannot convert multibyte text
      

      But if the system locale is, e.g. English (United States), and "chcp" reports "437", then both build well even with 6.5.4/6.6.1. I haven't tried other system locales yet.

      MSVC also has similar issue, that 6.5.4/6.6.1 cannot build UTF-8 .pro file when system encoding is SHIFT-JIS. Problem is the same, i.e. cannot find entry point, with message:

      :-1: error: LNK2001: unresolved external symbol WinMainCRTStartup
      

      Attachments

        1. config.txt
          4.03 MB
        2. encoding_test.zip
          9 kB
        3. screenshot-1.png
          screenshot-1.png
          54 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes