## Appendix C

## Internationalization

This appendix describes setting the language displayed in the J2ME Wireless Toolkit 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:

- Messages displayed to the user
- Fonts used or other writing-specific information

By default, all KToolbar strings, that is, the entire User Interface (UI), are displayed in the language of the supported platform’s locale.

For example, Japanese characters can be displayed in KToolbar running on a Japanese Windows machine, provided that the correct localized J2ME Wireless Toolkit has been downloaded and installed.

You can set the `wtk.locale` property to have the KToolbar displayed in a specified locale’s language. For example, you can have the toolkit running on a Japanese machine but still have the KToolbar 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 J2ME Wireless Toolkit. The `wtk.locale` property should be placed in the {toolkit}`\wtklib\`{platform}`\ktools.properties` file, where {platform} is the name of the underlying platform (`Windows` or `Linux`, for example).

## C.2 Emulated Locale

The `microedition.locale` property is the MIDP system property that defines the current locale of the device, which is `null` by default. For the J2ME Wireless Toolkit emulator, this value is automatically set to the default locale for the J2SE environment you are running. For example:

- If you are running in an English system in the US, the `microedition.locale` is set to `en-US`.
- If you are running in a French system, the `microedition.locale` is set to `fr-FR`.

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

You can override the default value by adding the `microedition.locale` property to the file {toolkit}`\wtklib\`{platform}`\ktools.properties` file and define the property as desired, as shown in the following examples:

    microedition.locale=en-US
    microedition.locale=null

For details on setting a default locale, see the J2ME Wireless Toolkit Basic Customization Guide.

## C.3 Character Encodings

The CLDC system property, `microedition.encoding,` defines the default character encoding name of the MIDP environment. In the J2ME Wireless Toolkit 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 J2SE environment running on the same window system. For example, in an English window system, the encoding setting is

    microedition.encoding=ISO8859_1

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

    microedition.encoding=UTF-8

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

Note – All the J2SE encoders are available in the emulated environment. See the J2ME Wireless Toolkit Basic Customization Guide for information on how to limit the list of available encoders for a specific device.

### C.3.1 Java 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 J2SE environment running on the same window system.

You can override the default value by adding the `javac.encoding` property to the {toolkit}`\wtklib\`{platform}`\ktools.properties` file, where {platform} is the name of the underlying platform, like `Windows` or `Linux`. 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.4 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 J2SE environment Java 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 J2ME Wireless Toolkit Basic Customization Guide for information on how to configure them.

| J2ME Wireless Toolkit User's Guide J2ME Wireless Toolkit 2.2

Copyright © 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to the license terms.