Setting Character Encoding for Java Files

By default, the IDE displays and saves all of your files in your system's default character encoding. This character encoding determines how the IDE interprets characters beyond the ASCII character set. You can specify character encoding at the IDE default level or for individual files.

You can also set the encoding that is used by different compiler types at compile time. When you compile a file, the IDE looks for encoding settings in the following order:

  1. In the settings for the compiler type associated with the file.
  2. In the individual file's Encoding property.
  3. In the Default Encoding property for Java Sources settings.
  4. The system's default encoding.

To set the character encoding for a compiler type:

  1. Choose Tools and choose Options from the Main Window.
  2. Expand Building and expand Compiler Types and select a compiler type.
  3. Click the Encoding property in the Properties tab and type the encoding name. If you do not want to specify the encoding for the compiler type, leave the property blank.

To set the character encoding for a file:

  1. Right-click the file's Explorer node and choose Properties.
  2. Click the Text tab.
  3. Click the Encoding property and type the encoding name. If you do not want to specify the encoding at this level, leave the property blank.

To set the default character encoding for the IDE or a project:

  1. Choose Tools and choose Options from the Main Window.
  2. Expand the Editing node and select Java Sources.
  3. Click the Expert Tab.
  4. Click the Default Encoding property and type the encoding name. To use your system's default encoding, leave the property blank.

For more information on supported encodings, visit the Sun Microsystems web page at http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html

See also
Synchronizing Source Code
Using the Import Management Tool
Configuring Java Settings
Configuring the Compiler

Legal Notices