Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 1.3.81 (2.0.0-alpha)
-
None
-
Linux, Unix
-
1dc99e8ff38c31fab948c5c57f47a492961841f2
Description
Steps to reproduce:
1. Unpack attached project test-project.tar.gz to some directory
2. Open the project File->Open File or Project...
3. Make sure that Project Pane is visible and that test project is expanded
There is only one item visible under the project: test.pro. The files main.cpp, mainwindow.cpp, mainwindow.h and mainwindow.ui do not appear in the project although the project builds, runs and debugs successfully.
The cause of the issue is IoUtils::FileType IoUtils::fileType() in src/shared/proparser/ioutils.cpp. There is a comment in the method which says that latin1 encoding is used for symmety to the file reader. However this seems to have at least two problems:
a) It does not take into account the fact that the parent path to project files may contain any characters. As it is the case with modern Linux distribution file names are encoded in UTF-8. Therefore the crossing between UTF-8 and ISO-8859-1 results in ASCII-7 characters only as a valid subset for file paths.
b) If file names in .pro files contain latin1 (ISO-8859-1) characters that fails with qmake since it seems qmake treats file name as byte sequence and therefore expects file name encoded in native platform encoding which is in most cases UTF-8 (at least this is how qmake behaves in Linux).
The attached patch ioutils.cpp.patch fixes the case (a) but does not fix case (b).
Attachments
Issue Links
- resulted in
-
QTCREATORBUG-10274 Character corruption occurs in utf-8 encoded .pro file
-
- Closed
-