★ wanayoo — archive 1999 http://ibm.com/java/education/international-unicode/unicode2.0.htmlNouvelle recherche | Portail wanayoo

Introducing IBM's International Classes for Unicode


2.0 Converting your Application

We will take you through a step-by-step process of converting your application into a global one. This will also guide you in making an application global from the beginning. For more detailed information about each of the topics, you should consult the most recent Java International API documentation as well as the documentation for the ICU. Thoroughly covering all the issues involved in developing global applications is beyond the scope of this paper, but there are a number of resources available on the Web or in print. See the references at the end of this document.

2.1 Software Globalization in Java vs. C++/C

The International Classes for Unicode are implemented in C++ and Java. C wrappers interfacing with the C++ libraries were implemented and included in the libraries in order to make it possible to globalize an ANSI-C application. The Java version of the ICU is shipped with the JDK 1.x.

There are, design differences that lie in the core of Java and C++ that lead to some differences in the implementation and design of the ICU. Java has Unicode characters and Unicode strings as base types along with a host of useful methods. C++ and ANSI C do not have inherent support for Unicode. So UnicodeString and UniChar classes, along with some useful methods pertaining to them (see following examples) are provided in the C/C++ ICU.

Some design decisions were made to take full advantage of the particular characteristics of the programming language they were written for. For example, in Java, Locale data is stored in compiled, "class" files where objects can be stored. In C++ (and thus C) the Locale data is stored in a human-readable text format, in a file located in a user-specified directory.

In the course of this section our examples are additive, with each successive one adding to code that may already have been converted to some extent. For brevity, we don't declare the types of the variables in each example, but chose descriptive variables names to imply these types. We also use a method called display in all three languages for purposes of illustration.

When the user starts up a global application, the default locale will be used for the display text and other user interface elements. If the user changes the default locale (generally with some mechanism on the host system), then you can get a different user interface language. (If you wish, you can go further, and support a multilingual user interface that allows use of simultaneous multiple locales. We'll discuss this later.)





JavaTM is a trademark of Sun Microsystems, Inc.

Microsoft is a registered trademark of Microsoft Corporation.

Other companies, products, and service names may be trademarks or service marks of others.

Copyright    Trademark



IBM HomeOrderEmployment