Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
On Monday, 2 August 2021 07:36:49 PDT David M. Cotter wrote: > does anyone have any idea about this? please? You didn't say what the problem was. Qt doesn't know the encoding of your source files. You must either tell the compiler to convert all string literals to UTF-8 or you must convert them yourself to UTF-8 or UTF-16 before passing to QString. You said you'd done that: > all my strings are handled internally (converted from MacRoman to utf16), > and only sent to QString when i need that at the very edge of a GUI API. > at that time they are converted from my internal rep (utf16) to utf8, then > to QString That sounds like the solution. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel DPG Cloud Engineering ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
my code in MANY places assumes that the charset is macRoman, and converts from macRoman to unicode. i'd have to change all those places, and there is no easy way to find them all. it's just a lot of work i don't want to do right now > On Aug 27, 2021, at 3:43 AM, Joerg Bornemann wrote: > > On 8/2/21 4:36 PM, David M. Cotter wrote: > >> does anyone have any idea about this? please? > > I was about to suggest something. But you wrote: > > > and no, before you suggest it, i can't convert the sources to utf8 > > encoding either, cuz that would break a lot of other stuff. > > Why does converting your source code "break a lot of other stuff"? > > > BR, > > Joerg > ___ > Interest mailing list > Interest@qt-project.org > https://lists.qt-project.org/listinfo/interest ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
On 8/2/21 4:36 PM, David M. Cotter wrote: does anyone have any idea about this? please? I was about to suggest something. But you wrote: > and no, before you suggest it, i can't convert the sources to utf8 > encoding either, cuz that would break a lot of other stuff. Why does converting your source code "break a lot of other stuff"? BR, Joerg ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
does anyone have any idea about this? please? > On Jul 9, 2021, at 12:38 PM, David M. Cotter wrote: > >> Please note that you can choose to use a different source character set, but >> since Qt 5.0, the 8-bit strings passed to QString must be UTF-8. This is not >> configurable any more, like it used to be. > yes, i'm not constructing any QStrings using the file encoding. all my > strings are handled internally (converted from MacRoman to utf16), and only > sent to QString when i need that at the very edge of a GUI API. at that time > they are converted from my internal rep (utf16) to utf8, then to QString > >> Moreover, since 6.0, the locale character set on Unix systems > this is a windows system > > -dave > ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
> Please note that you can choose to use a different source character set, but > since Qt 5.0, the 8-bit strings passed to QString must be UTF-8. This is not > configurable any more, like it used to be. yes, i'm not constructing any QStrings using the file encoding. all my strings are handled internally (converted from MacRoman to utf16), and only sent to QString when i need that at the very edge of a GUI API. at that time they are converted from my internal rep (utf16) to utf8, then to QString > Moreover, since 6.0, the locale character set on Unix systems this is a windows system -dave ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
On Friday, 9 July 2021 00:49:53 PDT Alexandru Croitor wrote: > I think adding > > CONFIG += no_utf8_source > > to your qmake project should help. Please note that you can choose to use a different source character set, but since Qt 5.0, the 8-bit strings passed to QString must be UTF-8. This is not configurable any more, like it used to be. Moreover, since 6.0, the locale character set on Unix systems must also be UTF-8. You'll get a warning from QCoreApplication if it isn't, then it'll forcibly change the locale to one with UTF-8. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel DPG Cloud Engineering ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
Hi, I think adding CONFIG += no_utf8_source to your qmake project should help. > On 9. Jul 2021, at 03:26, Mike Chinander wrote: > > Does it let you remove the utf-8 option? > >> QMAKE_CXXFLAGS -= /utf-8 > > On Thu, Jul 8, 2021 at 8:20 PM David M. Cotter wrote: > all my source code was originally written on mac in the late 90's early > aughts. (of course more written since, but using same source file text > encoding) > > it's a monumental project, with localizations in about over half a dozen > languages > > all the source code, and therefore the in-line strings are "MacRoman" text > encoding: strings have curly quotes, and ellipsis, and who knows what else > non-ascii characters > > this worked just fine up 'till Qt 5, the windows compiler would would just > swallow the MacRoman strings and they would show up in the ui, properly > localized (i use my own localization subsystem) > > but with Qt6, the msdev compiler chokes on all my non-ascii strings. > > come to find out Qt6 is passing "/source-charset:utf-8" to the compiler. > how did i find out? > > cuz i tried to explicitly pass "/source-charset:.1" in my .pro file, like > this: > >> QMAKE_CXXFLAGS += /source-charset:.1 > > but then i get an error saying this: >> cl : Command line error D8016 : '/source-charset:.1' and '/utf-8' >> command-line options are incompatible > > so what gives? has qt6 taken away my right to decide the encoding of my own > files? > > i have THOUSANDS of files. and if i change the strings, that is a very big > cost relating to re-translating them for localization. > > and no, before you suggest it, i can't convert the sources to utf8 encoding > either, cuz that would break a lot of other stuff. > > how do i fix this? > > -dave > ___ > Interest mailing list > Interest@qt-project.org > https://lists.qt-project.org/listinfo/interest > ___ > Interest mailing list > Interest@qt-project.org > https://lists.qt-project.org/listinfo/interest ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest
Re: [Interest] Qt6 porting guidance: (MSDEV) QMAKE_CXXFLAGS += /source-charset
Does it let you remove the utf-8 option? QMAKE_CXXFLAGS -= /utf-8 On Thu, Jul 8, 2021 at 8:20 PM David M. Cotter wrote: > all my source code was originally written on mac in the late 90's early > aughts. (of course more written since, but using same source file text > encoding) > > it's a monumental project, with localizations in about over half a dozen > languages > > all the source code, and therefore the in-line strings are "MacRoman" text > encoding: strings have curly quotes, and ellipsis, and who knows what else > non-ascii characters > > this worked just fine up 'till Qt 5, the windows compiler would would just > swallow the MacRoman strings and they would show up in the ui, properly > localized (i use my own localization subsystem) > > but with Qt6, the msdev compiler chokes on all my non-ascii strings. > > come to find out Qt6 is passing "/source-charset:utf-8" to the compiler. > how did i find out? > > cuz i tried to explicitly pass "/source-charset:.1" in my .pro file, > like this: > > QMAKE_CXXFLAGS += /source-charset:.1 > > > but then i get an error saying this: > > cl : Command line error D8016 : '/source-charset:.1' and '/utf-8' > command-line options are incompatible > > > so what gives? has qt6 taken away my right to decide the encoding of my > own files? > > i have THOUSANDS of files. and if i change the strings, that is a very big > cost relating to re-translating them for localization. > > and no, before you suggest it, i can't convert the sources to utf8 > encoding either, cuz that would break a lot of other stuff. > > how do i fix this? > > -dave > ___ > Interest mailing list > Interest@qt-project.org > https://lists.qt-project.org/listinfo/interest > ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest