Qt6 sets UNICODE on Windows

Yu Jin yu_jin at lyx.org
Sat May 29 16:43:23 UTC 2021


Am Sa., 29. Mai 2021 um 10:57 Uhr schrieb Yu Jin <yu_jin at lyx.org>:

>
>
> Am Sa., 29. Mai 2021 um 10:22 Uhr schrieb Kornel Benko <kornel at lyx.org>:
>
>> Am Sat, 29 May 2021 09:56:06 +0200
>> schrieb Yu Jin <yu_jin at lyx.org>:
>>
>> > this is connected to the Beta 1 tarballs, trying to build LyX I stumbled
>> > across this:
>> > [image: grafik.png]
>> > Apparently Qt6 sets UNICODE and _UNICODE on LyX (and only on LyX) when
>> > configuring without LYX_CONSOLE. It does that by setting the character
>> set
>> > to Unicode (as shown in the screenshot above) and it also sets the
>> > "UNICODE" and "_UNICODE" preprocessor definitions manually. Qt5 does
>> not do
>> > that. I have just tried to manually change the character set and remove
>> > those definitions in Visual Studio and it worked just fine. Any Idea if
>> > this is intended by us or how we can prevent it? Maybe in CMake?
>>
>> The only setting for UNICODE i see is in
>>         development/Win32/vld/cmake/CMakeLists.txt
>> This is used, if LYX_VLD is set. But this should be OFF on default.
>>
>
> Thank you for your response. Actually it is Qt6 after all, I just tested
> on a minimal example, it seems that Windows GUI applications are indeed
> defaulted to UNICODE on Qt6. I also just found in the keynote here:
> https://www.qtdesktopdays.com/wp-content/uploads/2020/09/keynote.pdf
>
> QtCore classes can now only deal with Unicode encodings
> –For other encodings: QTextCodec in Qt5Compat
>
> Don't really understand what that really means for LyX. But Qt5Compat is
> used, so I hope it will be fine. I will ask in the Qt Forum how the UNICODE
> default can be deactivated.
>

There was a bug report already:
https://bugreports.qt.io/browse/QTBUG-89951
apparently the unicode default will stay for all WIN32 (Windows GUI)
applications and it will be possible to disable only with the next (6.1.1)
release.

But I also think that the "universal" function calls (CreateNamedPipe() and
WaitNamedPipe()) should be made specific (CreateNamedPipeA() and
WaitNamedPipeA()), because the arguments are also specific (c_str() always
returns const char*). I have attached the patch showing it, the patch alone
fixes the compilation with unicode definition (can I commit it?). Once Qt
6.1.1 releases though, I will create a patch to disable unicode in CMake
again.
-- 
    Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210529/5ed49c16/attachment.html>


More information about the lyx-devel mailing list