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.)