About Project Encodings
See Also
By default, newly-created projects in the IDE use UTF-8 character encoding.
This encoding determines how the IDE interprets characters beyond the
ASCII character set. The IDE displays and saves any new files you create
using the encoding set by the project in which they reside. If you
want to change encoding properties, the IDE provides you with the ability
to do so manually.
Setting Character Encoding
To change the character encoding for a project:
- Right-click the project node in the Projects window and choose Properties.
- In the left column under Categories, select Sources.
- In the Encoding drop-down list, select the character encoding that you want
to be applied to the project. Click OK. The new encoding is applied to the
project you are working in.
Notes:
- When you change the encoding for a project, all new files are created using
the new project encoding.
- The new value that you set for project encoding is retained as the global
project encoding value for new projects. Therefore, when you create a new
project, the IDE uses the encoding value of the previously created project
for the new project.
Encoding Detection in the IDE
The IDE implements the FileEncodingQuery (FEQ) layer model. FEQ is an
interface for obtaining information about which encoding can be used
for reading from/writing to a particular file. The layer model prioritizes
encoding based on the following hierarchy:
- File FEQ. The encoding value declared within a file.
- Project FEQ. The value of the current global project
encoding in a session.
- Fallback FEQ. The encoding of the locale in which the
IDE is running.
Opening Older Projects
Previous versions of the IDE (including 5.x) did not implement the FEQ.
Consequently, any project created from older versions will be opened
using the fallback FEQ, i.e. the default locale set by your system's environment.
- If you change the project encoding property on a project that already
contains files that were created using a specific character encoding,
there is a risk that compiling and running the project may not succeed.
This is due to the fact that the programming compiler needs to be
passed an encoding value, and there can only be one such value.
Neither the IDE nor the programming language performs automatic encoding
detection of files.
- See Also
- About File Encodings
Legal Notices