I.6. Using Unicode

Numerous programming languages (e.g., C, Java, JavaScript, Perl, Visual Basic) provide some level of support for the Unicode Standard. The application shown in Fig. I.3Fig. I.4 prints the text “Welcome to Unicode!” in eight different languages: English, Russian, French, German, Japanese, Portuguese, Spanish and Traditional Chinese.

Figure I.3. Java application that uses Unicode encoding
 1  // Fig. F.3: UnicodeJFrame.java
 2  // Demonstrating how to use Unicode in Java programs.
 3  import java.awt.GridLayout;
 4  import javax.swing.JFrame;
 5  import javax.swing.JLabel;
 6
 7  public class UnicodeJFrame extends JFrame
 8  {
 9     // constructor creates JLabels to display Unicode
10     public UnicodeJFrame()
11     {
12        super( "Demonstrating Unicode" ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.