Spec-Zone .ru
спецификации, руководства, описания, API

Internationalization Enhancements in JDK 7

The Internationalization enhancements for JDK7 include the following:

New Scripts and Characters from Unicode 5.1.0

The J2SE 5.0 and Java SE 6 releases support Unicode 4.0.0, which was released in 2003. The JDK7 release now supports Unicode 5.1.0, which was released in 2008. As a result, the JDK7 release has more than 4200 new characters (24 new scripts):

In the Java language, users can use these new characters/scripts by using the Character, String and other classes. For example, Coptic is one of scripts which was supported in Unicode 5.0.0 (not in 5.1.0).

http://www.unicode.org/charts/PDF/U2C80.pdf

Now, by using JDK7-M3, you can get Coptic uppercase or lowercase with Characer.toUpperCase(), String.toLowerCase() and so on. Other methods in the Character class, for example the get*() and is*() methods, work for these new characters, too.

Scripts can be accessed using Character.UnicodeBlock class. 46 new blocks have been added in this Unicode 5.1.0 support.

Extensible Support for ISO 4217 Currency Codes

Currencies are identified by their ISO 4217 codes. These codes maintained by an external agency and are released independent of the Java SE platform. As of JDK7, it is possible to accommodate new currencies without requiring a new release of the JDK.

To supersede the default currency at runtime, create a properties file named <JAVA_HOME>/lib/currency.properties. This file contains the key/value pairs of the ISO 3166 country code, and the ISO 4217 currency data. The value part consists of three comma-separated ISO 4217 currency values: an alphabetic code, a numeric code, and a minor unit. Any lines beginning with the hash character, #, are treated as comment lines. For example:

# Sample currency property for Japan
JP=JPZ,999,0
The new API for this feature includes the following methods, all in the Currency class:

Category Locale Support

The Windows platform allows the user to independently set the default locale for two types of uses: the "Standards and Formats" setting is used for formatting resources, and the "Display Language" setting is used in menus and dialogs. The new getLocale(Locale.Category) method takes a Locale.Category parameter. Passing the FORMAT enum to the method returns the default locale for formatting resources. Similarly, passing the DISPLAY enum returns the default locale used by the UI. The no-argument getDefault method returns the "Display Language" default.



Java Technology

Copyright © 1993, 2010, Oracle and/or its affiliates. All rights reserved.

Contact Us