Important: Please read the Qt Code of Conduct -

[Solved] Qt creator 2.3 problem with C++ source files encoding

  • Hi to all,

    I am developing on several projects at the same time and most of the components are part of the new Qt-Complex 2.0 release so they are fully reusable in all the platforms. Thus I develop using Windows 7 debugging on Symbian devices and Mac when debugging on N950 while the source code of the framework classes is frequently copied between the Windows 7 project folder and the Mac folder.

    After the last update of the SDK including the Qt Creator 2.3 I experience - only on some sources, mostly .h include files - an error when I try to open them on the Qt Creator on Mac after that these was managed by Qt Creator on Windows 7. I receive an encoding error: ignoring this the file is opened as read-only by the IDE.
    If I ask to use some encode by the dialog windows appearing when happens this issue I see a list with a lot of valid encodings. So I assign the encoding that seems to me the most simple and common (one of the ISO proposed) and the file is opened correctly.

    The fact is that I am not sure of what I am doing and if this behavior depends from something I missed. Should I change something in the encoding in the windows or Mac platforms while saving or creating the file? I have not found nothing of similar until I have not got this error (or warning, not sure...)

    Anyone has some idea ? Thanks in advance.

  • You can try set Default Encoding to UTF-8 in Text Editor options on both platform.

  • Maybe that the update has lost some default settings ?

  • By default I think it set to System default encoding. So I think default system encoding for win difference for mac
    This might be changed in new QtCreator

  • Thank you Vass, helpful hint :)

Log in to reply