Sun Microsystems Computer Accessories manual Locales, Character Encodings

Page 56

Locales

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

Some operations are locale-sensitive and require a specified locale to tailor information for users, such as:

Messages displayed to the user

Cultural information such as, dates and currency formats

In the Default Emulator, the default locale is determined by the platform’s locale. To define a default locale, use the following definition:

microedition.locale: <default_locale>

A locale name is comprised of two parts separated by an dash (-), for example, en-USis the locale designation for english/United States while en-AUis the designation for english/Australia.

The first part is a valid ISO Language Code. These codes are the lower-case two- letter codes as defined by ISO-639. You can find a full list of these codes at a number of sites, such as:

http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt

The second part is a valid ISO Country Code. These codes are the upper-case two- letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as:

http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html

Character Encodings

The input/output APIs in CLDC use named character encodings to convert 8-bit characters into 16-bit Unicode characters, and vice-versa. A MIDP implementation might make only a small set of encodings available for MIDlets to use.

In the Default Emulator, the default encoding is default encoder of the platform you are running on. Your emulator might use other encodings, such as UTF-8 and UTF-16, providing they are available in the J2SE platform.

To define the default character encoding used by the emulator, use the following definition:

microedition.encoding: <default_encoding>

To define the set of all available encodings, use the following definition:

microedition.encoding.supported: <list of encodings>

For example:

42 Wireless Toolkit Basic Customization Guide • December 2003

Image 56
Contents Basic Customization Guide Please Contents Examining Device Property Files Default Emulator Device Property Files Vi Wireless Toolkit Basic Customization Guide December Figures Viii Wireless Toolkit Basic Customization Guide December Tables Wireless Toolkit Basic Customization Guide December Who Should Use This Book How This Book Is OrganizedUsing Operating System Commands Related Documentation Typographic ConventionsShell Prompts Accessing Sun Documentation Online Sun Welcomes Your CommentsCustomizing the Wireless Toolkit How to Customize the Wireless ToolkitDevice Property Files and the Default Emulator Customization StepsCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Creating Device Property Files Make a Copy of an Existing Main Device Property FileObtain and Enter Image Files Obtain and Enter the Screen Properties Screen LocationTotal Screen Size Display AreaDisplay Area in Full Screen Mode Specifying Screen PropertiesObtain and Enter the Button Properties By measuring the image file, obtain the button propertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Obtain and Enter Icon Properties Defining the Icon Location and StatesEnter the following measured values for the icons properties Screen Background RGB Color Enter Color PropertiesRun the Emulator for the New Device Examining Device Property Files Device Property Files Fonts Used by the Midp APIs Main Device Property FileFonts Bitmap Fonts Default FontSystem Fonts Ascii character Distance to character Font Underlining Device ImageImage without Buttons Pressed Image with Buttons PressedImage with Buttons Highlighted and Backlight On ScalingScreen Properties Screen Location Display Area Display Area in Full Screen ModeTotal Screen Size Screen Pixel Ratio Screen Background ColorScreen Buffering Screen Border ColorTouch Screen Defining a Device Button Device ButtonsKeyboard Handler Button.LEFT = 13, 197, 20 Assigning a PC Keyboard Key to a Button Assigning a Game Action to a Button Specifying the Characters Generated by a Button PressAssigning Abstract Commands to Buttons Abstract Command Types in Order of PrecedenceEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Displayed Icons Defining the Icon Location and StatesSoft Button Label Display Soft Button Labels on the Emulated Device DisplayColor Sound AlertsDevice Software Capabilities Alert Type ValuesLocales Character EncodingsEnableAlphaChannel false Transparent ImagesWireless Toolkit Basic Customization Guide December Default Emulator Device Property Files Property FilesDefaultGrayPhone.properties Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December # alert.alerttype.sound soundfile Wireless Toolkit Basic Customization Guide December Device Image Files Icon Image FilesIcon Image Files Support for ByteCode Obfuscators Adding a ByteCode ObfuscatorExample Appendix B Support for ByteCode Obfuscators Wireless Toolkit Basic Customization Guide December P E N D I X C Wireless Toolkit Basic Customization Guide December Index Keyboard.handler property Device property files, 1 WMA messages, customizing Wireless Toolkit Basic Customization Guide December