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

Qt WebEngine: Force treating source code as UTF-8 on Windows

    XMLWordPrintable

Details

    Description

      A customer reported this:

      Since my Windows is Korean language, MSVC tries to decode all source code in CP949 but some source codes from gn and chromium contains non-ASCII characters and they are obviously encoded in UTF-8. This can be easily fixed by adding '/utf-8' flag when compiling.

      Would it make sense to set CMAKE_CXX_FLAGS="/utf-8" and CMAKE_C_FLAGS="/utf-8" automatically for MSVC builds? (see https://stackoverflow.com/questions/47690822/possible-to-force-cmake-msvc-to-use-utf-8-encoding-for-source-files-without-a-bo )

      Also, https://github.com/qt/qtwebengine-chromium/blob/772cb04f511b9a1b98a4e155ed62efdfd971e5fb/chromium/tools/idl_parser/idl_parser.py#L1318 raises an invalid byte sequence error when the wrong encoding is assumed. (To be patched upstream?)

      - with open(filename) as fileobject:
      + with open(filename, encoding="utf-8") as fileobject:
      

      Attachments

        Issue Links

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

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes