Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP  Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP,Python
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP, Python Java Servlets Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, Python,JSP
Java Servlets Application Hosting Web Hosting Sign-Up Java Servlets Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting  Java Servlets Application Hosting Resellers web hosting, website hosting, web site hosting Java Servlets Application Hosting EZ Site Control Panel for web hosting,website hosting, web site hosting
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python,JSP,  Fundraising
Java Servlets Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting
WWW.

Call Us Toll-Free
(877) 256-0328

Outside USA
1 - (201) 505-0430

Java Servlets Application Hosting Welcome Java Servlets Application Hosting Web Hosting Plans Overview , Fund Raising, Fundraising, web hosting, website hosting, web site hosting Java Servlets Application Hosting Fund Raising, Fundraising, web hosting Java Servlets Application Hosting Resellers, web Hosting Java Servlets Application Hosting Web Design, web Hosting Java Servlets Application Hosting Extra Services,  web Hosting Java Servlets Application Hosting Traffic Booster, web hosting Java Servlets Application Hosting Traffic Booster, web hosting Java Servlets Application Hosting Technical Support,  web Hosting Java Servlets Application Hosting webmaster tips,  web Hosting Java Servlets Application Hosting 30 Day Money Back, web hosting Java Servlets Application Hosting Legal Notices for Web Hosting Java Servlets Application Hosting Glossary Computer Terms for web Hosting Java Servlets Application Hosting Contact Information - web hosting

Site Map
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python, JSP Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Normalizer's API (The Java™ Tutorials > Internationalization > Working with Text)
Trail: Internationalization
Lesson: Working with Text
Home Page > Internationalization > Working with Text
Normalizer's API

Normalization is the process by which you can perform certain transformations of text to make it reconcilable in a way which it may not have been before. Let's say, you would like searching or sorting text, in this case you need to normalize that text to account for code points that should be represented as the same text.

What can be normalized? The normalization is applicable when you need to convert characters with diacritical marks, change all letters case, decompose ligatures, or convert half-width katakana characters to full-width characters and so on.

In accordance with the Unicode Standard Annex #15 the Normalizer's API supports all of the following four Unicode text normalization forms that are defined in the java.text.Normalizer.Form :

  • NFC – Normalization Form Composition
  • NFD – Normalization Form Decomposition
  • NFKC – Normalization Form Canonical Composition
  • NFKD – Normalization Form Canonical Decomposition

Let's examine how the latin small letter “o” with diaeresis can be normalized by using these normalization forms:

Original word NFC NFD NFKC NFKD
"schön" "schön" "scho\u0308n" "schön" "scho\u0308n"

You can notice that an original word is left unchanged in NFC and NFKC. This is because with NFD and NFKD, composite characters are mapped to their canonical decompositions. But with NFC and NFKC, combining character sequences are mapped to composites, if possible. There is no composite for diaeresis, so it is left decomposed in NFC and NFKC.

In the code example, NormSample.java , which is represented later, you can also notice another normalization feature. The half-width and full-width katakana characters will have the same compatibility decomposition and are thus compatibility equivalents. However, they are not canonical equivalents.

To be sure that you really need to normalize the text you may use the isNormalized method to determine if the given sequence of char values is normalized. If this method returns false, it means that you have to normalize this sequence and you should use the normalize method which normalizes a char values according to the specified normalization form. For example, to transform text into the canonical decomposed form you will have to use the following normalize method:

normalized_string = Normalizer.normalize(target_chars, Normalizer.Form.NFD);

Also, the normalize method rearranges accents into the proper canonical order, so that you do not have to worry about accent rearrangement on your own.

The following example represents an application that enables you to select a normalization form and a template to normalize:


Note: If you don't see the applet running above, you need to install release 6 of the JDK.
Previous page: Character and Byte Streams
Next page: Internationalization of Network Resources
 
 
 

Add to My Yahoo!

XML icon

Add to Google

 

 

 

 

 

 

 

 

 

 

 

JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP at JSP.aldenWEBhosting.com Servlets at servlets.aldenWEBhosting.com Tomcat at Tomcat.aldenWEBhosting.com mysql at mysql.aldenWEBhosting.com Java at Java.aldenWEBhosting.com Web Hosts Portal Web Links Web Links Web Hosting JSP Solutions Web Links JSP Solutions Web Hosting Servlets Solutions Web Links Servlets Solutions Web Hosting Web Links Web Links . . .
.
.
. .
.
. .
. . . . . . . . . . . jsp hosting servlets hosting web hosting web sites designed cheap web hosting web site hosting myspace web hosting