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

Allow UTF-8 in qt sources

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P1: Critical
    • 6.0
    • None
    • Other
    • None

    Description

      Change compiler flags and tell the compiler that Qt sources are utf8.

       

      Original report below:

      I only tried windows 10, msvc 2015 64bit, latest 5.6 branch, but my code page is 936(Simplified Chinese).

      Control Panel->Region, in Administrative tab, click "Change system locale...", and select "Chinese(Simplified, China)".

      There are warnings like:

              cl -c -FIqt_pch.h -Yuqt_pch.h -Fp.pch\release\Qt5Core_pch.pch -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -EHsc -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -DUNICODE -DWIN32 -DWIN64 -DQT_NO_USING_NAMESPACE -DPCRE_STATIC -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_DEBUG -DNDEBUG -D_WINDLL -IC:\qt\qt5\qtbase\src\corelib -I. -IC:\qt\qt5\qtbase\src\3rdparty\zlib -Iglobal -IC:\qt\qt5\qtbase\src\3rdparty\pcre -IC:\qt\qt5\qtbase\src\3rdparty\harfbuzz\src -IC:\qt\qt5\qtbase\src\3rdparty\md5 -IC:\qt\qt5\qtbase\src\3rdparty\md4 -IC:\qt\qt5\qtbase\src\3rdparty\sha3 -I..\..\include -I..\..\include\QtCore -I..\..\include\QtCore\5.6.2 -I..\..\include\QtCore\5.6.2\QtCore -Itmp -I.moc\release -IC:\qt\qt5\qtbase\mkspecs\win32-msvc2015 -Fo.obj\release\ @C:\Users\QiLiang\AppData\Local\Temp\qstring.obj.1184.344.jom
      qstring.cpp
      C:\qt\qt5\qtbase\src\corelib\tools\qstring.cpp(1655): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
              link /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x67000000 /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.6 /MANIFEST:embed /OUT:..\..\lib\Qt5Core.dll @C:\Users\QiLiang\AppData\Local\Temp\Qt5Core.dll.1184.1610.jom
         Creating library ..\..\lib\Qt5Core.lib and object ..\..\lib\Qt5Core.exp
              copy /y ..\..\lib\Qt5Core.dll ..\..\bin
              1 file(s) copied.
      

      Other references: http://lists.qt-project.org/pipermail/development/2016-March/025450.html

      tools/qstring.cpp:1834,80: Non-printable character  #8594 (0x2192) '→'
      tools/qstring.cpp:1893,69: Non-printable character  #8594 (0x2192) '→'
      tools/qstring.cpp:8295,57: Non-printable character  #8805 (0x2265) '≥'
      tools/qstring.cpp:8306,57: Non-printable character  #8805 (0x2265) '≥'
      

      Attachments

        1. qtbug56155_npn56_161012.txt
          119 kB
        2. qtbug56155_npn56_161012.tasks
          119 kB
        3. filechecker.zip
          6 kB
        4. before.jpg
          before.jpg
          0.8 kB
        5. after.jpg
          after.jpg
          2 kB
        6. 645px-GBK_encoding.svg.png
          645px-GBK_encoding.svg.png
          74 kB

        Issue Links

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

          Activity

            People

              peppe Giuseppe D'Angelo
              liaqi Liang Qi
              Votes:
              2 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes