Configuring Eclipse File Encoding for Agentry Projects

Prerequisites
Before performing this procedure the following items must be addressed:
  • The Agentry Editor plug-in and Eclipse Platform must be installed.
  • The file associations should be configured for .sql, .bat or .sh, as needed, within the Eclipse Platform.
  • Identify the file encoding format for any Java source files that may be opened within the same workspace as the Agentry application project.
Task

This procedure describes the steps to configure the file encoding settings and preferences within the Eclipse platform as required by the Agentry Editor plug-in. The assumption is that the file editors for the various file types have been configured based on the recommendations provided by Syclo. If one or more different file editors are to be used for certain file types, the following procedure may or may not be valid. Those tools described here do not support or provide editor-specific file encoding, instead inheriting this behavior from the Eclipse workspace settings.

This procedure configures the current Eclipse workspace to use the file encoding format UTF-16, which is a unicode format. This will then result in all text editing tools treating all text files opened in any editor as if they are encoded in this format. Certain files external the Agentry application project but possibly a part of its overall implementation may not be encoded in this format. The primary example of such files would be Java files for a JVM system connection. The Java perspective within Eclipse does have a preference setting for file encoding. This is set for an individual Java project. The proper encoding setting for Java projects is dependent upon how those Java source files were encoded upon creation. The common option for such files is the UTF-8 encoding. However, other encoding formats are possible and this should be determined before making changes.

  1. Start the Eclipse platform and open the workspace to be used for the Agentry Editor. Once Eclipse is started, select the menu item Window | Preferences. In the tree control on the left of the Preferences screen select General -> Workspace.

    This will display the Preferences page for the current workspace.

  2. On this page look for the section Text file encoding. Select the Other radio button and then select the item UTF-16 in the associated drop down list.
  3. Click the [OK] button to close the Preferences screen and apply the changes. If a Java project is not to be opened within this same workspace, or if the Java project’s files have been encoded with UTF-16, no further actions are needed. Otherwise, continue on with this procedure.
  4. Switch to the Java perspective in Eclipse and open the Java project for this same workspace. Select the menu item Project | Properties.

    This will display the Properties page for the java project:

  5. In the tree control to the left select the item Resource. Then look for the section Text file encoding. Select the radio button Other and then select the proper encoding option based on the encoding of the source files in the Java project. Note that if these files are encoded in either ASCII or UTF-8, then UTF-8 can be selected. For other file encoding formats select the proper item.
  6. Click the [OK] button to close the Properties page and save these changes.

This procedure results in changing the Eclipse workspace’s default file encoding for all text files to the unicode format UTF-16. This is the encoding in which all text files created by the Editor are formatted. The exception to this are java source files.