Jump to Real's How-to Main page

Display "special character" using Unicode

The copyright symbol © :
String COPYRIGHT = "\u00a9"";
The registered symbol ® :
String REGISTERED = "\u00ae";
The euro-currency sign € :
String EURO = "\u20ac"
For example :
import java.awt.*;
public class TestUnicode extends java.applet.Applet {

  public static final String COPYRIGHT  = "\u00a9";
  public static final String REGISTERED = "\u00ae";
  public static final String EURO = "\u20ac";

  public void init () {
   setLayout(new FlowLayout());
   Label a = new Label(COPYRIGHT + " R\u00e9al Gagnon");
   Label b = new Label(REGISTERED + " R\u00e9al's Software "
                       + " price : 100 " + EURO);
   add(a); 
   add(b); 
  }
}

Output :
Java not enabled!

A list of Unicode characters is available at the Unicode organization Web site.

Here a quick list for accented letters :

á\u00e0Á\u00c0
à\u00e1À\u00c1
â\u00e2Â\u00c2
é\u00e9É\u00c9
è\u00e8È\u00c8
ê\u00eaÊ\u00ca
î\u00eeÎ\u00ce
ç\u00e7Ç\u00c7



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2008
[ home ]