10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Character Sets and Encodings<br />

<strong>The</strong> <strong>Java</strong>Server Faces version of Duke’s Bookstore uses date/time and number converters to<br />

format dates and numbers in a locale-sensitive manner. For example, the same shipping date is<br />

converted in the <strong>Java</strong>Server Faces version as follows:<br />

<br />

<br />

<br />

For information on <strong>Java</strong>Server Faces converters, see “Using the Standard Converters” on<br />

page 352.<br />

Character Sets and Encodings<br />

470<br />

<strong>The</strong> following sections describe character sets and character encodings.<br />

Character Sets<br />

A character set is a set of textual and graphic symbols, each of which is mapped to a set of<br />

nonnegative integers.<br />

<strong>The</strong> first character set used in computing was US-ASCII. It is limited in that it can represent<br />

only American English. US-ASCII contains uppercase and lowercase Latin alphabets,<br />

numerals, punctuation, a set of control codes, and a few miscellaneous symbols.<br />

Unicode defines a standardized, universal character set that can be extended to accommodate<br />

additions. When the <strong>Java</strong> program source file encoding doesn’t support Unicode, you can<br />

represent Unicode characters as escape sequences by using the notation \uXXXX, where XXXX<br />

is the character’s 16-bit representation in hexadecimal. For example, the Spanish version of the<br />

Duke’s Bookstore message file uses Unicode for non-ASCII characters:<br />

{"TitleCashier", "Cajero"},<br />

{"TitleBookDescription", "Descripci" + "\u00f3" + "n del<br />

Libro"},<br />

{"Visitor", "El visitante" + "\u00fa" + "mero "},<br />

{"What", "Qu" + "\u00e9" + " libros leemos"},<br />

{"Talk", " describe cómo los componentes de software de web<br />

pueden transformar la manera en que desarrollamos las<br />

aplicaciones para la web. Este libro es obligatorio para<br />

cualquier programador de respeto!"},<br />

{"Start", "Empezar a Comprar"},<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!