could be represented by the same code, so the letter
in English could use the same code as a different let-
ter in a different language (obviously, not optimal).
Unicode represents characters as a 16-bit number, allowing for over 65,000 possible characters, making it an
ideal solution to internationalization concerns. Additionally, the first 128 Unicode characters are, in fact, the
128 ASCII characters, making compatibility with older English-language applications much easier.
All Unicode characters, including ASCII, are represented in Unicode as a four-digit hexadecimal value
prefixed with a
to indicate a Unicode character. For example,
is the Unicode form of the
(which can also be represented using ASCII syntax as
cial characters like
. For example:
Not sure what this line does? It presents an alert with the text
to the user. Using the
Unicode character set, you can create messages in any number of languages. Even though the plain text
form of such messages isn’t human readable, it’s still the only way to deal with multibyte characters
from other languages.
Browser versus operating system support
operating system can. Why should this concern Web developers who care only about what the browser
do its job, although most developers never realize it. For internationalization, you must be aware of this
very important boundary.
Any time you use
, you are using an operating system dialog box.
Unless the client operating system has foreign language support installed, you end up with a dialog full
of gibberish. Most of the time, the browser reflects the language of the operating system, however you
never can tell what individuals with do with their browsers.
When using operating system dialogs with internationalization, be aware that these problems can occur.
When dealing with a distributed Web application, it may be enough to inform the customer of this limi-
tation; on public Web sites, however, it may be best to avoid using these dialogs altogether.
Oftentimes in internationalized Web pages, developers try to pass strings from a server-side variable
<% String sJspHello = “Hello”; %>
<!-- more code here -->
22_579088 ch19.qxd 3/28/05 11:43 AM Page 571