QT6 qmake doesn't find utf8 encoding and rewrites non-ascii strings ruining files
-
wrote on 16 Sept 2024, 17:19 last edited by gfxx
I write the same on other post .... sorry for these, but focus of that post was gcc version for compiler .... now discover other problem and different.
Reading a lot discover is an old story that QT language encoding is "problematic", but first time touch these with my hands ....on Bookworm, try to upgrade my app from 5.15.2 to qt6.6.3 ... pherhaps wasting some days discover qt6.5.3 have some other problem .... so I purge my qt6.5 install and I start with one completely new .... at the end all work ... or better, code error is disppear during compile time ..... instead I note for first time warning on qmake session (probabily there are in previous time too, but I was concentrate to solve compiling error) ..... from some time discover 2 heather file (that contains some necessary non ordinary row for compose a test list for a widget) is ruined .... discover because a extremely long list of error appears during compiling time .... so I use gedit for check my file .... and discover these two one ..... every time I cancel ruined file and copy the backup one ..... but at qmake time these happens again .... so I study for 2 days all avaiable on internet about locale file for bookworm .... I correct my locale .... but is all the same ...
after a lot of work I have still these error:
(repeated more than one time ... almost 80 time ... everytime 2 or 1 file was ruined and replace it from a backup folder) Detected locale "LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
But these is my locale commad output ....
@mint51:~$ locale LANG=it_IT.UTF-8 LANGUAGE=it_IT.UTF-8 LC_CTYPE="it_IT.UTF-8" LC_NUMERIC="it_IT.UTF-8" LC_TIME="it_IT.UTF-8" LC_COLLATE="it_IT.UTF-8" LC_MONETARY="it_IT.UTF-8" LC_MESSAGES="it_IT.UTF-8" LC_PAPER="it_IT.UTF-8" LC_NAME="it_IT.UTF-8" LC_ADDRESS="it_IT.UTF-8" LC_TELEPHONE="it_IT.UTF-8" LC_MEASUREMENT="it_IT.UTF-8" LC_IDENTIFICATION="it_IT.UTF-8" LC_ALL=it_IT.UTF-8
some one can indicate me a workaround for solve these problem? One file pehaps is a stylesheet.qrc file ... difficult to change it .....
##################################################################################
################ UPADATE ############################
##################################################################################AFTER SOME DAYS WASTE .... I understand "locale" tree of Debian Bookworm ..... seems is needed en_US.UTF-8 in some point ... like LC_ALL for send the right decode info to QT6. If not you have the warning posted here ......
-
I write the same on other post .... sorry for these, but focus of that post was gcc version for compiler .... now discover other problem and different.
Reading a lot discover is an old story that QT language encoding is "problematic", but first time touch these with my hands ....on Bookworm, try to upgrade my app from 5.15.2 to qt6.6.3 ... pherhaps wasting some days discover qt6.5.3 have some other problem .... so I purge my qt6.5 install and I start with one completely new .... at the end all work ... or better, code error is disppear during compile time ..... instead I note for first time warning on qmake session (probabily there are in previous time too, but I was concentrate to solve compiling error) ..... from some time discover 2 heather file (that contains some necessary non ordinary row for compose a test list for a widget) is ruined .... discover because a extremely long list of error appears during compiling time .... so I use gedit for check my file .... and discover these two one ..... every time I cancel ruined file and copy the backup one ..... but at qmake time these happens again .... so I study for 2 days all avaiable on internet about locale file for bookworm .... I correct my locale .... but is all the same ...
after a lot of work I have still these error:
(repeated more than one time ... almost 80 time ... everytime 2 or 1 file was ruined and replace it from a backup folder) Detected locale "LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
But these is my locale commad output ....
@mint51:~$ locale LANG=it_IT.UTF-8 LANGUAGE=it_IT.UTF-8 LC_CTYPE="it_IT.UTF-8" LC_NUMERIC="it_IT.UTF-8" LC_TIME="it_IT.UTF-8" LC_COLLATE="it_IT.UTF-8" LC_MONETARY="it_IT.UTF-8" LC_MESSAGES="it_IT.UTF-8" LC_PAPER="it_IT.UTF-8" LC_NAME="it_IT.UTF-8" LC_ADDRESS="it_IT.UTF-8" LC_TELEPHONE="it_IT.UTF-8" LC_MEASUREMENT="it_IT.UTF-8" LC_IDENTIFICATION="it_IT.UTF-8" LC_ALL=it_IT.UTF-8
some one can indicate me a workaround for solve these problem? One file pehaps is a stylesheet.qrc file ... difficult to change it .....
##################################################################################
################ UPADATE ############################
##################################################################################AFTER SOME DAYS WASTE .... I understand "locale" tree of Debian Bookworm ..... seems is needed en_US.UTF-8 in some point ... like LC_ALL for send the right decode info to QT6. If not you have the warning posted here ......
wrote on 17 Sept 2024, 19:01 last edited by gfxx@gfxx after these regarding the issue of files being corrupted by qmake, the problem stems from the fact that these were old files edited with 'Notepad' and also with 'gedit' on Ubuntu, which of course uses a more common encoding compared to Debian 12, which instead follows standardized encoding. Once imported into Debian 12, these files cannot be correctly encoded by QT6, regardless of the 'locale' settings. The solution is to open the old files with 'xed' and save them. At that point, QT6 encodes them according to the system's requirements, does not corrupt them, and interprets them correctly.
P.S. It is not advisable to use Debian Bookworm with QT6... Just today, my 'mirror' sent me kernel updates, which, among other things, involve uninstalling libdcb6 and using a proprietary library integrated directly into the kernel... I don’t know if this might cause problems, but I fear it could, and quite a few at that...
P.S. -2- For other reasons I upgrade to qt6.7.2 .... all utf-8 messages about encoding is disappear ....
-
-
1/2