A P P E N D I X  C

Localization

This appendix describes setting the language displayed in the Sun JavaTM Wireless Toolkit for CLDC and the localization setting of the emulation environment.


C.1 Locale Setting

A locale is a geographic or political region or community that shares the same language, customs, or cultural conventions. In software, a locale is represented by a collection of files, data, and code, which contains the information necessary to adapt software to a specific location.

Some software uses a locale to tailor information for users, such as:

By default, all strings in the user interface are displayed in the language of the supported platform's locale.

For example, Japanese characters can be displayed in a toolkit that is running on a Japanese Microsoft Windows machine, provided that the correct localized Sun JavaTM Wireless Toolkit for CLDC is downloaded and installed.

You can set the wtk.locale property to have the user interface displayed in a specified locale's language. As discussed in Section 3.8, Configuring the Wireless Toolkit, you must copy ktools.properties from the installation directory to your working directory (workdir/wtklib/ktools.properties), then edit your copy. For example, you can have the toolkit running on a Japanese machine but still have the user interface display shown in English by setting the locale property to en-US, and making sure that the proper supplement has been downloaded and installed over the Sun JavaTM Wireless Toolkit for CLDC.


C.2 Emulated Locale

A device's locale is contained in the system property microedition.locale. You can change the emulator's locale by choosing Edit > Preferences and selecting i18n. Choose a locale from the combo box or type it in directly.

For information on microedition.locale, consult the MIDP specification.


C.3 Character Encodings

The CLDC system property, microedition.encoding, defines the default character encoding name of the MIDP environment. In the Sun JavaTM Wireless Toolkit for CLDC emulator, this property is set according to the underlying window system you are using. The property's value is set to the default encoding for the Java SE platform running on the same window system. For example, in an English window system, the encoding setting is as follows:

microedition.encoding=ISO8859_1

You can override the default value by adding the microedition.encoding property to the workdir\wtklib\ktools.properties file. For example, if you want to use UTF-8 as the default setting on Microsoft Windows, you can set the property in the workdir\wtklib\ktools.properties file as follows:

microedition.encoding=UTF-8

For more information on character encoding, see the CLDC specification.



Note - All the Java SE platform encoders are available in the emulated environment. See the Sun JavaTM Wireless Toolkit for CLDC Basic Customization Guide for information on how to limit the list of available encoders for a specific device.



C.4 Java Technology Compiler Encoding Setting

The javac.encoding property determines the encoding used by the javac compiler to compile your source files. The property's value is set to the default encoding for the Java SE platform running on the same window system.

You can override the default value by adding the javac.encoding property to the ktools.properties file. For example, if you are running in an English system but find you need to compile a Japanese resource bundle, you can specify a Japanese character set, such as:

javac.encoding=EUCJIS


C.5 Font Support in the Default Emulator

The default fonts that are used in the emulated environment are set according to the underlying window system locale. By default, the MIDP environment fonts are mapped to the default Java SE platform Java technology fonts. These fonts usually support all the characters that are required by the current window's locale.

You can override these fonts to support other characters that are not supported by the default fonts. See the Sun Javatrademark Wireless Toolkit for CLDC Basic Customization Guide for information on how to configure them.