-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt6: recent project paths are stored in QGIS.ini in UTF-8 (instead of hex-escaped Unicode), incompatible with Qt5 version #60088
Comments
Issue valid for windows too |
Same for news feed |
Thank you for the extra information confirming that Qt created the situation. A few years ago, in one of the final Qt5 releases, they should have made Qt5 capable of reading the new Qt6 format – it would have been easy to do and effective. Now it's up to applications such as QGIS to work around their dropped ball. The Qt6 choice of using UTF-8 for the ini file is sound, as well as being the (already established) way of the future. The most appropriate fix would therefore be to add code in QGIS Qt5 builds to handle UTF-8 correctly if it is present in the ini file. (There is no ambiguity, as the Qt5 format uses only USASCII characters to do its custom hex encoding of Unicode.) It would be a wrapper around whatever Qt call is used to read the ini file. No need to do anything when writing the ini file, since the Qt5 format is read correctly by Qt6. |
The job can probably be done (Qt5 builds only) with
|
Note that it will also be necessary to insert |
We could also rename the ini file for qt6 builds ( |
QGIS4.ini would be more user-friendly, I think. This solution may be simpler (and acceptable to users as long as the old ini file is migrated). Advantages of a pair of calls to
Disadvantages:
|
What is the bug or the crash?
Using a Mac Qt6 build (thanks @m-kuhn!)
– the QGIS.ini file from regular (Qt5) releases is interpreted correctly
– but when it is written back out, recent project paths are encoded in UTF-8
The UTF-8 encoded QGIS.ini cannot be read correctly by Qt5 QGIS, which tries to interpret each octet of UTF-8 as if it were a separate Unicode character.
The UTF-8 QGIS.ini is (fortunately) interpreted correctly by Qt6 QGIS. Switching back and forth between Qt5 and Qt6 builds, however, leads to increasing problems.
Steps to reproduce the issue
Versions
QGIS version | 3.41.0-Master -- | -- QGIS code revision | 9f6d7bd Libraries Qt version | 6.8.1 Python version | 3.11.10 GDAL/OGR version | 3.9.3 PROJ version | 9.5.1 EPSG Registry database version | v11.022 (2024-11-05) GEOS version | 3.13.0-CAPI-1.19.0 SQLite version | 3.47.2 PDAL version | 2.8.1 PostgreSQL client version | unknown SpatiaLite version | 5.1.0 QWT version | 6.3.0 QScintilla2 version | 2.14.1 OS version | macOS Sonoma (14.7) Active Python plugins db_manager | 0.1.20 MetaSearch | 0.3.6 processing | 2.12.99QGIS version
3.41.0-Master
QGIS code revision
9f6d7bd6
Libraries
Qt version
6.8.1
Python version
3.11.10
GDAL/OGR version
3.9.3
PROJ version
9.5.1
EPSG Registry database version
v11.022 (2024-11-05)
GEOS version
3.13.0-CAPI-1.19.0
SQLite version
3.47.2
PDAL version
2.8.1
PostgreSQL client version
unknown
SpatiaLite version
5.1.0
QWT version
6.3.0
QScintilla2 version
2.14.1
OS version
macOS Sonoma (14.7)
Active Python plugins
db_manager
0.1.20
MetaSearch
0.3.6
processing
2.12.99
Supported QGIS version
New profile
Additional context
Although this is not an issue if one sticks to Qt5 or Qt6, it makes switching back and forth difficult (unless one limits filenames to ASCII characters). Some sort of workaround would be helpful to avoid problems when the transition arrives.
The text was updated successfully, but these errors were encountered: