[Development] Shall we turn on /utf-8 compiler option when build qt for Windows?

Viktor Engelmann viktor.engelmann at qt.io
Mon Jan 30 11:09:54 CET 2017

I have a unit test for webengine that sends an HTTP Post request
which includes several unicode characters (outside of ä,ö,ü or other
Latin1 characters). I deliberately did that to make the test harder
to pass.

Am 29.01.2017 um 10:33 schrieb André Pönitz:
> On Sun, Jan 29, 2017 at 12:13:48PM +0800, Liang Jian wrote:
>>     Start from qt-5.8 I can't build qt anymore under Windows(simplified
>> chinese locale). Since there is a file
>> src/plugins/generic/tuiotouch/qtuiohandler.cpp which contain non-latin-1
>> character, msvc2015 assume the source code's character set should be CP936
>> which make the complilation fail.
>>     I can only build qt by comment the line which contain the specical
>> character in src/plugins/generic/tuiotouch/qtuiohandler.cpp.
>>     But if I turn on -developer-build in configuration step, thing will get
>> worse than before, since -developer-build means treat warning as error, and
>> again I can't build qt anymore since there are other files contain
>> non-latin1 character (such as qstring.cpp), the build will fail due to the
>> character set warning.
>>     I am working on a Windows 10 x64 simplifed chinese machine, msvc2015
>> update3
>>     For more detail please refer to
>> https://bugreports.qt.io/browse/QTBUG-58161
>>     As a workaround, I have to modify the file
>> qtbase/mkspecs/common/msvc-desktop.conf
>> QMAKE_CFLAGS            = -nologo -Zc:wchar_t /utf-8
>>     After I add /utf-8 compiler option the build goes well.
>>     Shall we turn on this compiler option by default?
> We should remove non-ASCII characters from the sources if they cause problems.
> If some non-ASCII is unproblematic (like the 'ä' in some copyright lines)
> on all supported compilers, that's fine to have, but mining log messages
> or comments with characters that are known to cause issues in the processing
> are a mindless waste of resources.
> Andre'
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development


Viktor Engelmann
Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin

Viktor.Engelmann at qt.io
+49 151 26784521

Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 144331 B

More information about the Development mailing list