Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.1
-
Windows 11 with CP949 default locale(Korean Windows)
-
-
63f83fb13 (dev), 0075672da (dev)
Description
On Windows, most of users do not use UTF-8 for system locale for legacy programs compatibility.
And, MSVC's cl decodes source code with system locale code page, for instance, CP949 in Korean Windows.
This behavior can be overridden with /utf-8 flag (which corresponds to set /source-charset:utf-8 /execution-charset:utf-8 simultaneously).
Without /utf-8 flag, if there exists any non-ascii unicode character in source code, cl emits C4819 warning and, I don't know where it is set but, the warning treated as error and compilation fails.
This corresponds to even the QtCore module because there are non-ascii characters in comment, for instance, in qproperty.h,
‘std::source_location::current()’
where quotation marks are non-ascii.
As a matter of fact, I guess, most of non-ascii characters appear at comment only and I think adding /utf-8 flag by default is harmless.
Or, at least, /source-charset:utf-8 should be harmless because Qt's source codes are already encoded in UTF-8.
I am not sure about /execution-charset:utf-8 flag but I think you know what you should use although I've never encountered issue for /utf-8 flag anyway.
There are some build scripts which contains hardcoded compiler flags, for instance, in QtWebEngine, the build script for gn contains hardcoded compiler flags for msvc. Such list should contain /utf-8 or /source-charset:utf-8 at least too.
To be clear, this is a bug to be fixed not a feature request nice to have because Windows/MSVC is officially supported platform and Qt should be compilable on Windows with MSVC by default.
Attachments
Issue Links
- relates to
-
QTBUG-121726 Qt WebEngine: Force treating source code as UTF-8 on Windows
-
- Reported
-