Definitions of HTML character entities and conversions between unicode characters and HTML character entities : HTML Output « Servlets « Java






Definitions of HTML character entities and conversions between unicode characters and HTML character entities

   
/*
 * Enhydra Java Application Server Project
 * 
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License on
 * the Enhydra web site ( http://www.enhydra.org/ ).
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
 * the License for the specific terms governing rights and limitations
 * under the License.
 * 
 * The Initial Developer of the Enhydra Application Server is Lutris
 * Technologies, Inc. The Enhydra Application Server and portions created
 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
 * All Rights Reserved.
 * 
 * Contributor(s):
 * 
 * $Id: HTMLEntities.java,v 1.1.1.1 2003-03-10 16:36:17 taweili Exp $
 */

// FIXME: convert this to an interface and then have implementing classes
// for HTML3.2 and 4.0


/**
 * Definitions of HTML character entities and conversions
 * between unicode characters and HTML character entities.
 */
public class HTMLEntities {
    /**
     * Unicode character for entity <tt>quot</tt> (\u0022).
     */
    public static final char quot = '\u0022';

    /**
     * Unicode character for entity <tt>amp</tt> (\u0026).
     */
    public static final char amp = '\u0026';

    /**
     * Unicode character for entity <tt>lt</tt> (\u003c).
     */
    public static final char lt = '\u003c';

    /**
     * Unicode character for entity <tt>gt</tt> (\u003e).
     */
    public static final char gt = '\u003e';

    /**
     * Unicode character for entity <tt>nbsp</tt> (\u00a0).
     */
    public static final char nbsp = '\u00a0';

    /**
     * Unicode character for entity <tt>iexcl</tt> (\u00a1).
     */
    public static final char iexcl = '\u00a1';

    /**
     * Unicode character for entity <tt>cent</tt> (\u00a2).
     */
    public static final char cent = '\u00a2';

    /**
     * Unicode character for entity <tt>pound</tt> (\u00a3).
     */
    public static final char pound = '\u00a3';

    /**
     * Unicode character for entity <tt>curren</tt> (\u00a4).
     */
    public static final char curren = '\u00a4';

    /**
     * Unicode character for entity <tt>yen</tt> (\u00a5).
     */
    public static final char yen = '\u00a5';

    /**
     * Unicode character for entity <tt>brvbar</tt> (\u00a6).
     */
    public static final char brvbar = '\u00a6';

    /**
     * Unicode character for entity <tt>sect</tt> (\u00a7).
     */
    public static final char sect = '\u00a7';

    /**
     * Unicode character for entity <tt>uml</tt> (\u00a8).
     */
    public static final char uml = '\u00a8';

    /**
     * Unicode character for entity <tt>copy</tt> (\u00a9).
     */
    public static final char copy = '\u00a9';

    /**
     * Unicode character for entity <tt>ordf</tt> (\u00aa).
     */
    public static final char ordf = '\u00aa';

    /**
     * Unicode character for entity <tt>laquo</tt> (\u00ab).
     */
    public static final char laquo = '\u00ab';

    /**
     * Unicode character for entity <tt>not</tt> (\u00ac).
     */
    public static final char not = '\u00ac';

    /**
     * Unicode character for entity <tt>shy</tt> (\u00ad).
     */
    public static final char shy = '\u00ad';

    /**
     * Unicode character for entity <tt>reg</tt> (\u00ae).
     */
    public static final char reg = '\u00ae';

    /**
     * Unicode character for entity <tt>macr</tt> (\u00af).
     */
    public static final char macr = '\u00af';

    /**
     * Unicode character for entity <tt>deg</tt> (\u00b0).
     */
    public static final char deg = '\u00b0';

    /**
     * Unicode character for entity <tt>plusmn</tt> (\u00b1).
     */
    public static final char plusmn = '\u00b1';

    /**
     * Unicode character for entity <tt>sup2</tt> (\u00b2).
     */
    public static final char sup2 = '\u00b2';

    /**
     * Unicode character for entity <tt>sup3</tt> (\u00b3).
     */
    public static final char sup3 = '\u00b3';

    /**
     * Unicode character for entity <tt>acute</tt> (\u00b4).
     */
    public static final char acute = '\u00b4';

    /**
     * Unicode character for entity <tt>micro</tt> (\u00b5).
     */
    public static final char micro = '\u00b5';

    /**
     * Unicode character for entity <tt>para</tt> (\u00b6).
     */
    public static final char para = '\u00b6';

    /**
     * Unicode character for entity <tt>middot</tt> (\u00b7).
     */
    public static final char middot = '\u00b7';

    /**
     * Unicode character for entity <tt>cedil</tt> (\u00b8).
     */
    public static final char cedil = '\u00b8';

    /**
     * Unicode character for entity <tt>sup1</tt> (\u00b9).
     */
    public static final char sup1 = '\u00b9';

    /**
     * Unicode character for entity <tt>ordm</tt> (\u00ba).
     */
    public static final char ordm = '\u00ba';

    /**
     * Unicode character for entity <tt>raquo</tt> (\u00bb).
     */
    public static final char raquo = '\u00bb';

    /**
     * Unicode character for entity <tt>frac14</tt> (\u00bc).
     */
    public static final char frac14 = '\u00bc';

    /**
     * Unicode character for entity <tt>frac12</tt> (\u00bd).
     */
    public static final char frac12 = '\u00bd';

    /**
     * Unicode character for entity <tt>frac34</tt> (\u00be).
     */
    public static final char frac34 = '\u00be';

    /**
     * Unicode character for entity <tt>iquest</tt> (\u00bf).
     */
    public static final char iquest = '\u00bf';

    /**
     * Unicode character for entity <tt>Agrave</tt> (\u00c0).
     */
    public static final char Agrave = '\u00c0';

    /**
     * Unicode character for entity <tt>Aacute</tt> (\u00c1).
     */
    public static final char Aacute = '\u00c1';

    /**
     * Unicode character for entity <tt>Acirc</tt> (\u00c2).
     */
    public static final char Acirc = '\u00c2';

    /**
     * Unicode character for entity <tt>Atilde</tt> (\u00c3).
     */
    public static final char Atilde = '\u00c3';

    /**
     * Unicode character for entity <tt>Auml</tt> (\u00c4).
     */
    public static final char Auml = '\u00c4';

    /**
     * Unicode character for entity <tt>Aring</tt> (\u00c5).
     */
    public static final char Aring = '\u00c5';

    /**
     * Unicode character for entity <tt>AElig</tt> (\u00c6).
     */
    public static final char AElig = '\u00c6';

    /**
     * Unicode character for entity <tt>Ccedil</tt> (\u00c7).
     */
    public static final char Ccedil = '\u00c7';

    /**
     * Unicode character for entity <tt>Egrave</tt> (\u00c8).
     */
    public static final char Egrave = '\u00c8';

    /**
     * Unicode character for entity <tt>Eacute</tt> (\u00c9).
     */
    public static final char Eacute = '\u00c9';

    /**
     * Unicode character for entity <tt>Ecirc</tt> (\u00ca).
     */
    public static final char Ecirc = '\u00ca';

    /**
     * Unicode character for entity <tt>Euml</tt> (\u00cb).
     */
    public static final char Euml = '\u00cb';

    /**
     * Unicode character for entity <tt>Igrave</tt> (\u00cc).
     */
    public static final char Igrave = '\u00cc';

    /**
     * Unicode character for entity <tt>Iacute</tt> (\u00cd).
     */
    public static final char Iacute = '\u00cd';

    /**
     * Unicode character for entity <tt>Icirc</tt> (\u00ce).
     */
    public static final char Icirc = '\u00ce';

    /**
     * Unicode character for entity <tt>Iuml</tt> (\u00cf).
     */
    public static final char Iuml = '\u00cf';

    /**
     * Unicode character for entity <tt>ETH</tt> (\u00d0).
     */
    public static final char ETH = '\u00d0';

    /**
     * Unicode character for entity <tt>Ntilde</tt> (\u00d1).
     */
    public static final char Ntilde = '\u00d1';

    /**
     * Unicode character for entity <tt>Ograve</tt> (\u00d2).
     */
    public static final char Ograve = '\u00d2';

    /**
     * Unicode character for entity <tt>Oacute</tt> (\u00d3).
     */
    public static final char Oacute = '\u00d3';

    /**
     * Unicode character for entity <tt>Ocirc</tt> (\u00d4).
     */
    public static final char Ocirc = '\u00d4';

    /**
     * Unicode character for entity <tt>Otilde</tt> (\u00d5).
     */
    public static final char Otilde = '\u00d5';

    /**
     * Unicode character for entity <tt>Ouml</tt> (\u00d6).
     */
    public static final char Ouml = '\u00d6';

    /**
     * Unicode character for entity <tt>times</tt> (\u00d7).
     */
    public static final char times = '\u00d7';

    /**
     * Unicode character for entity <tt>Oslash</tt> (\u00d8).
     */
    public static final char Oslash = '\u00d8';

    /**
     * Unicode character for entity <tt>Ugrave</tt> (\u00d9).
     */
    public static final char Ugrave = '\u00d9';

    /**
     * Unicode character for entity <tt>Uacute</tt> (\u00da).
     */
    public static final char Uacute = '\u00da';

    /**
     * Unicode character for entity <tt>Ucirc</tt> (\u00db).
     */
    public static final char Ucirc = '\u00db';

    /**
     * Unicode character for entity <tt>Uuml</tt> (\u00dc).
     */
    public static final char Uuml = '\u00dc';

    /**
     * Unicode character for entity <tt>Yacute</tt> (\u00dd).
     */
    public static final char Yacute = '\u00dd';

    /**
     * Unicode character for entity <tt>THORN</tt> (\u00de).
     */
    public static final char THORN = '\u00de';

    /**
     * Unicode character for entity <tt>szlig</tt> (\u00df).
     */
    public static final char szlig = '\u00df';

    /**
     * Unicode character for entity <tt>agrave</tt> (\u00e0).
     */
    public static final char agrave = '\u00e0';

    /**
     * Unicode character for entity <tt>aacute</tt> (\u00e1).
     */
    public static final char aacute = '\u00e1';

    /**
     * Unicode character for entity <tt>acirc</tt> (\u00e2).
     */
    public static final char acirc = '\u00e2';

    /**
     * Unicode character for entity <tt>atilde</tt> (\u00e3).
     */
    public static final char atilde = '\u00e3';

    /**
     * Unicode character for entity <tt>auml</tt> (\u00e4).
     */
    public static final char auml = '\u00e4';

    /**
     * Unicode character for entity <tt>aring</tt> (\u00e5).
     */
    public static final char aring = '\u00e5';

    /**
     * Unicode character for entity <tt>aelig</tt> (\u00e6).
     */
    public static final char aelig = '\u00e6';

    /**
     * Unicode character for entity <tt>ccedil</tt> (\u00e7).
     */
    public static final char ccedil = '\u00e7';

    /**
     * Unicode character for entity <tt>egrave</tt> (\u00e8).
     */
    public static final char egrave = '\u00e8';

    /**
     * Unicode character for entity <tt>eacute</tt> (\u00e9).
     */
    public static final char eacute = '\u00e9';

    /**
     * Unicode character for entity <tt>ecirc</tt> (\u00ea).
     */
    public static final char ecirc = '\u00ea';

    /**
     * Unicode character for entity <tt>euml</tt> (\u00eb).
     */
    public static final char euml = '\u00eb';

    /**
     * Unicode character for entity <tt>igrave</tt> (\u00ec).
     */
    public static final char igrave = '\u00ec';

    /**
     * Unicode character for entity <tt>iacute</tt> (\u00ed).
     */
    public static final char iacute = '\u00ed';

    /**
     * Unicode character for entity <tt>icirc</tt> (\u00ee).
     */
    public static final char icirc = '\u00ee';

    /**
     * Unicode character for entity <tt>iuml</tt> (\u00ef).
     */
    public static final char iuml = '\u00ef';

    /**
     * Unicode character for entity <tt>eth</tt> (\u00f0).
     */
    public static final char eth = '\u00f0';

    /**
     * Unicode character for entity <tt>ntilde</tt> (\u00f1).
     */
    public static final char ntilde = '\u00f1';

    /**
     * Unicode character for entity <tt>ograve</tt> (\u00f2).
     */
    public static final char ograve = '\u00f2';

    /**
     * Unicode character for entity <tt>oacute</tt> (\u00f3).
     */
    public static final char oacute = '\u00f3';

    /**
     * Unicode character for entity <tt>ocirc</tt> (\u00f4).
     */
    public static final char ocirc = '\u00f4';

    /**
     * Unicode character for entity <tt>otilde</tt> (\u00f5).
     */
    public static final char otilde = '\u00f5';

    /**
     * Unicode character for entity <tt>ouml</tt> (\u00f6).
     */
    public static final char ouml = '\u00f6';

    /**
     * Unicode character for entity <tt>divide</tt> (\u00f7).
     */
    public static final char divide = '\u00f7';

    /**
     * Unicode character for entity <tt>oslash</tt> (\u00f8).
     */
    public static final char oslash = '\u00f8';

    /**
     * Unicode character for entity <tt>ugrave</tt> (\u00f9).
     */
    public static final char ugrave = '\u00f9';

    /**
     * Unicode character for entity <tt>uacute</tt> (\u00fa).
     */
    public static final char uacute = '\u00fa';

    /**
     * Unicode character for entity <tt>ucirc</tt> (\u00fb).
     */
    public static final char ucirc = '\u00fb';

    /**
     * Unicode character for entity <tt>uuml</tt> (\u00fc).
     */
    public static final char uuml = '\u00fc';

    /**
     * Unicode character for entity <tt>yacute</tt> (\u00fd).
     */
    public static final char yacute = '\u00fd';

    /**
     * Unicode character for entity <tt>thorn</tt> (\u00fe).
     */
    public static final char thorn = '\u00fe';

    /**
     * Unicode character for entity <tt>yuml</tt> (\u00ff).
     */
    public static final char yuml = '\u00ff';

    /**
     * Unicode character for entity <tt>fnof</tt> (\u0192).
     */
    public static final char fnof = '\u0192';

    /**
     * Unicode character for entity <tt>Alpha</tt> (\u0391).
     */
    public static final char Alpha = '\u0391';

    /**
     * Unicode character for entity <tt>Beta</tt> (\u0392).
     */
    public static final char Beta = '\u0392';

    /**
     * Unicode character for entity <tt>Gamma</tt> (\u0393).
     */
    public static final char Gamma = '\u0393';

    /**
     * Unicode character for entity <tt>Delta</tt> (\u0394).
     */
    public static final char Delta = '\u0394';

    /**
     * Unicode character for entity <tt>Epsilon</tt> (\u0395).
     */
    public static final char Epsilon = '\u0395';

    /**
     * Unicode character for entity <tt>Zeta</tt> (\u0396).
     */
    public static final char Zeta = '\u0396';

    /**
     * Unicode character for entity <tt>Eta</tt> (\u0397).
     */
    public static final char Eta = '\u0397';

    /**
     * Unicode character for entity <tt>Theta</tt> (\u0398).
     */
    public static final char Theta = '\u0398';

    /**
     * Unicode character for entity <tt>Iota</tt> (\u0399).
     */
    public static final char Iota = '\u0399';

    /**
     * Unicode character for entity <tt>Kappa</tt> (\u039a).
     */
    public static final char Kappa = '\u039a';

    /**
     * Unicode character for entity <tt>Lambda</tt> (\u039b).
     */
    public static final char Lambda = '\u039b';

    /**
     * Unicode character for entity <tt>Mu</tt> (\u039c).
     */
    public static final char Mu = '\u039c';

    /**
     * Unicode character for entity <tt>Nu</tt> (\u039d).
     */
    public static final char Nu = '\u039d';

    /**
     * Unicode character for entity <tt>Xi</tt> (\u039e).
     */
    public static final char Xi = '\u039e';

    /**
     * Unicode character for entity <tt>Omicron</tt> (\u039f).
     */
    public static final char Omicron = '\u039f';

    /**
     * Unicode character for entity <tt>Pi</tt> (\u03a0).
     */
    public static final char Pi = '\u03a0';

    /**
     * Unicode character for entity <tt>Rho</tt> (\u03a1).
     */
    public static final char Rho = '\u03a1';

    /**
     * Unicode character for entity <tt>Sigma</tt> (\u03a3).
     */
    public static final char Sigma = '\u03a3';

    /**
     * Unicode character for entity <tt>Tau</tt> (\u03a4).
     */
    public static final char Tau = '\u03a4';

    /**
     * Unicode character for entity <tt>Upsilon</tt> (\u03a5).
     */
    public static final char Upsilon = '\u03a5';

    /**
     * Unicode character for entity <tt>Phi</tt> (\u03a6).
     */
    public static final char Phi = '\u03a6';

    /**
     * Unicode character for entity <tt>Chi</tt> (\u03a7).
     */
    public static final char Chi = '\u03a7';

    /**
     * Unicode character for entity <tt>Psi</tt> (\u03a8).
     */
    public static final char Psi = '\u03a8';

    /**
     * Unicode character for entity <tt>Omega</tt> (\u03a9).
     */
    public static final char Omega = '\u03a9';

    /**
     * Unicode character for entity <tt>alpha</tt> (\u03b1).
     */
    public static final char alpha = '\u03b1';

    /**
     * Unicode character for entity <tt>beta</tt> (\u03b2).
     */
    public static final char beta = '\u03b2';

    /**
     * Unicode character for entity <tt>gamma</tt> (\u03b3).
     */
    public static final char gamma = '\u03b3';

    /**
     * Unicode character for entity <tt>delta</tt> (\u03b4).
     */
    public static final char delta = '\u03b4';

    /**
     * Unicode character for entity <tt>epsilon</tt> (\u03b5).
     */
    public static final char epsilon = '\u03b5';

    /**
     * Unicode character for entity <tt>zeta</tt> (\u03b6).
     */
    public static final char zeta = '\u03b6';

    /**
     * Unicode character for entity <tt>eta</tt> (\u03b7).
     */
    public static final char eta = '\u03b7';

    /**
     * Unicode character for entity <tt>theta</tt> (\u03b8).
     */
    public static final char theta = '\u03b8';

    /**
     * Unicode character for entity <tt>iota</tt> (\u03b9).
     */
    public static final char iota = '\u03b9';

    /**
     * Unicode character for entity <tt>kappa</tt> (\u03ba).
     */
    public static final char kappa = '\u03ba';

    /**
     * Unicode character for entity <tt>lambda</tt> (\u03bb).
     */
    public static final char lambda = '\u03bb';

    /**
     * Unicode character for entity <tt>mu</tt> (\u03bc).
     */
    public static final char mu = '\u03bc';

    /**
     * Unicode character for entity <tt>nu</tt> (\u03bd).
     */
    public static final char nu = '\u03bd';

    /**
     * Unicode character for entity <tt>xi</tt> (\u03be).
     */
    public static final char xi = '\u03be';

    /**
     * Unicode character for entity <tt>omicron</tt> (\u03bf).
     */
    public static final char omicron = '\u03bf';

    /**
     * Unicode character for entity <tt>pi</tt> (\u03c0).
     */
    public static final char pi = '\u03c0';

    /**
     * Unicode character for entity <tt>rho</tt> (\u03c1).
     */
    public static final char rho = '\u03c1';

    /**
     * Unicode character for entity <tt>sigmaf</tt> (\u03c2).
     */
    public static final char sigmaf = '\u03c2';

    /**
     * Unicode character for entity <tt>sigma</tt> (\u03c3).
     */
    public static final char sigma = '\u03c3';

    /**
     * Unicode character for entity <tt>tau</tt> (\u03c4).
     */
    public static final char tau = '\u03c4';

    /**
     * Unicode character for entity <tt>upsilon</tt> (\u03c5).
     */
    public static final char upsilon = '\u03c5';

    /**
     * Unicode character for entity <tt>phi</tt> (\u03c6).
     */
    public static final char phi = '\u03c6';

    /**
     * Unicode character for entity <tt>chi</tt> (\u03c7).
     */
    public static final char chi = '\u03c7';

    /**
     * Unicode character for entity <tt>psi</tt> (\u03c8).
     */
    public static final char psi = '\u03c8';

    /**
     * Unicode character for entity <tt>omega</tt> (\u03c9).
     */
    public static final char omega = '\u03c9';

    /**
     * Unicode character for entity <tt>thetasym</tt> (\u03d1).
     */
    public static final char thetasym = '\u03d1';

    /**
     * Unicode character for entity <tt>upsih</tt> (\u03d2).
     */
    public static final char upsih = '\u03d2';

    /**
     * Unicode character for entity <tt>piv</tt> (\u03d6).
     */
    public static final char piv = '\u03d6';

    /**
     * Unicode character for entity <tt>bull</tt> (\u2022).
     */
    public static final char bull = '\u2022';

    /**
     * Unicode character for entity <tt>hellip</tt> (\u2026).
     */
    public static final char hellip = '\u2026';

    /**
     * Unicode character for entity <tt>prime</tt> (\u2032).
     */
    public static final char prime = '\u2032';

    /**
     * Unicode character for entity <tt>Prime</tt> (\u2033).
     */
    public static final char Prime = '\u2033';

    /**
     * Unicode character for entity <tt>oline</tt> (\u203e).
     */
    public static final char oline = '\u203e';

    /**
     * Unicode character for entity <tt>frasl</tt> (\u2044).
     */
    public static final char frasl = '\u2044';

    /**
     * Unicode character for entity <tt>weierp</tt> (\u2118).
     */
    public static final char weierp = '\u2118';

    /**
     * Unicode character for entity <tt>image</tt> (\u2111).
     */
    public static final char image = '\u2111';

    /**
     * Unicode character for entity <tt>real</tt> (\u211c).
     */
    public static final char real = '\u211c';

    /**
     * Unicode character for entity <tt>trade</tt> (\u2122).
     */
    public static final char trade = '\u2122';

    /**
     * Unicode character for entity <tt>alefsym</tt> (\u2135).
     */
    public static final char alefsym = '\u2135';

    /**
     * Unicode character for entity <tt>larr</tt> (\u2190).
     */
    public static final char larr = '\u2190';

    /**
     * Unicode character for entity <tt>uarr</tt> (\u2191).
     */
    public static final char uarr = '\u2191';

    /**
     * Unicode character for entity <tt>rarr</tt> (\u2192).
     */
    public static final char rarr = '\u2192';

    /**
     * Unicode character for entity <tt>darr</tt> (\u2193).
     */
    public static final char darr = '\u2193';

    /**
     * Unicode character for entity <tt>harr</tt> (\u2194).
     */
    public static final char harr = '\u2194';

    /**
     * Unicode character for entity <tt>crarr</tt> (\u21b5).
     */
    public static final char crarr = '\u21b5';

    /**
     * Unicode character for entity <tt>lArr</tt> (\u21d0).
     */
    public static final char lArr = '\u21d0';

    /**
     * Unicode character for entity <tt>uArr</tt> (\u21d1).
     */
    public static final char uArr = '\u21d1';

    /**
     * Unicode character for entity <tt>rArr</tt> (\u21d2).
     */
    public static final char rArr = '\u21d2';

    /**
     * Unicode character for entity <tt>dArr</tt> (\u21d3).
     */
    public static final char dArr = '\u21d3';

    /**
     * Unicode character for entity <tt>hArr</tt> (\u21d4).
     */
    public static final char hArr = '\u21d4';

    /**
     * Unicode character for entity <tt>forall</tt> (\u2200).
     */
    public static final char forall = '\u2200';

    /**
     * Unicode character for entity <tt>part</tt> (\u2202).
     */
    public static final char part = '\u2202';

    /**
     * Unicode character for entity <tt>exist</tt> (\u2203).
     */
    public static final char exist = '\u2203';

    /**
     * Unicode character for entity <tt>empty</tt> (\u2205).
     */
    public static final char empty = '\u2205';

    /**
     * Unicode character for entity <tt>nabla</tt> (\u2207).
     */
    public static final char nabla = '\u2207';

    /**
     * Unicode character for entity <tt>isin</tt> (\u2208).
     */
    public static final char isin = '\u2208';

    /**
     * Unicode character for entity <tt>notin</tt> (\u2209).
     */
    public static final char notin = '\u2209';

    /**
     * Unicode character for entity <tt>ni</tt> (\u220b).
     */
    public static final char ni = '\u220b';

    /**
     * Unicode character for entity <tt>prod</tt> (\u220f).
     */
    public static final char prod = '\u220f';

    /**
     * Unicode character for entity <tt>sum</tt> (\u2211).
     */
    public static final char sum = '\u2211';

    /**
     * Unicode character for entity <tt>minus</tt> (\u2212).
     */
    public static final char minus = '\u2212';

    /**
     * Unicode character for entity <tt>lowast</tt> (\u2217).
     */
    public static final char lowast = '\u2217';

    /**
     * Unicode character for entity <tt>radic</tt> (\u221a).
     */
    public static final char radic = '\u221a';

    /**
     * Unicode character for entity <tt>prop</tt> (\u221d).
     */
    public static final char prop = '\u221d';

    /**
     * Unicode character for entity <tt>infin</tt> (\u221e).
     */
    public static final char infin = '\u221e';

    /**
     * Unicode character for entity <tt>ang</tt> (\u2220).
     */
    public static final char ang = '\u2220';

    /**
     * Unicode character for entity <tt>and</tt> (\u2227).
     */
    public static final char and = '\u2227';

    /**
     * Unicode character for entity <tt>or</tt> (\u2228).
     */
    public static final char or = '\u2228';

    /**
     * Unicode character for entity <tt>cap</tt> (\u2229).
     */
    public static final char cap = '\u2229';

    /**
     * Unicode character for entity <tt>cup</tt> (\u222a).
     */
    public static final char cup = '\u222a';

    /**
     * Unicode character for entity <tt>int</tt> (\u222b).
     */
    public static final char intChar = '\u222b';

    /**
     * Unicode character for entity <tt>there4</tt> (\u2234).
     */
    public static final char there4 = '\u2234';

    /**
     * Unicode character for entity <tt>sim</tt> (\u223c).
     */
    public static final char sim = '\u223c';

    /**
     * Unicode character for entity <tt>cong</tt> (\u2245).
     */
    public static final char cong = '\u2245';

    /**
     * Unicode character for entity <tt>asymp</tt> (\u2248).
     */
    public static final char asymp = '\u2248';

    /**
     * Unicode character for entity <tt>ne</tt> (\u2260).
     */
    public static final char ne = '\u2260';

    /**
     * Unicode character for entity <tt>equiv</tt> (\u2261).
     */
    public static final char equiv = '\u2261';

    /**
     * Unicode character for entity <tt>le</tt> (\u2264).
     */
    public static final char le = '\u2264';

    /**
     * Unicode character for entity <tt>ge</tt> (\u2265).
     */
    public static final char ge = '\u2265';

    /**
     * Unicode character for entity <tt>sub</tt> (\u2282).
     */
    public static final char sub = '\u2282';

    /**
     * Unicode character for entity <tt>sup</tt> (\u2283).
     */
    public static final char sup = '\u2283';

    /**
     * Unicode character for entity <tt>nsub</tt> (\u2284).
     */
    public static final char nsub = '\u2284';

    /**
     * Unicode character for entity <tt>sube</tt> (\u2286).
     */
    public static final char sube = '\u2286';

    /**
     * Unicode character for entity <tt>supe</tt> (\u2287).
     */
    public static final char supe = '\u2287';

    /**
     * Unicode character for entity <tt>oplus</tt> (\u2295).
     */
    public static final char oplus = '\u2295';

    /**
     * Unicode character for entity <tt>otimes</tt> (\u2297).
     */
    public static final char otimes = '\u2297';

    /**
     * Unicode character for entity <tt>perp</tt> (\u22a5).
     */
    public static final char perp = '\u22a5';

    /**
     * Unicode character for entity <tt>sdot</tt> (\u22c5).
     */
    public static final char sdot = '\u22c5';

    /**
     * Unicode character for entity <tt>lceil</tt> (\u2308).
     */
    public static final char lceil = '\u2308';

    /**
     * Unicode character for entity <tt>rceil</tt> (\u2309).
     */
    public static final char rceil = '\u2309';

    /**
     * Unicode character for entity <tt>lfloor</tt> (\u230a).
     */
    public static final char lfloor = '\u230a';

    /**
     * Unicode character for entity <tt>rfloor</tt> (\u230b).
     */
    public static final char rfloor = '\u230b';

    /**
     * Unicode character for entity <tt>lang</tt> (\u2329).
     */
    public static final char lang = '\u2329';

    /**
     * Unicode character for entity <tt>rang</tt> (\u232a).
     */
    public static final char rang = '\u232a';

    /**
     * Unicode character for entity <tt>loz</tt> (\u25ca).
     */
    public static final char loz = '\u25ca';

    /**
     * Unicode character for entity <tt>spades</tt> (\u2660).
     */
    public static final char spades = '\u2660';

    /**
     * Unicode character for entity <tt>clubs</tt> (\u2663).
     */
    public static final char clubs = '\u2663';

    /**
     * Unicode character for entity <tt>hearts</tt> (\u2665).
     */
    public static final char hearts = '\u2665';

    /**
     * Unicode character for entity <tt>diams</tt> (\u2666).
     */
    public static final char diams = '\u2666';

    /**
     * Unicode character for entity <tt>OElig</tt> (\u0152).
     */
    public static final char OElig = '\u0152';

    /**
     * Unicode character for entity <tt>oelig</tt> (\u0153).
     */
    public static final char oelig = '\u0153';

    /**
     * Unicode character for entity <tt>Scaron</tt> (\u0160).
     */
    public static final char Scaron = '\u0160';

    /**
     * Unicode character for entity <tt>scaron</tt> (\u0161).
     */
    public static final char scaron = '\u0161';

    /**
     * Unicode character for entity <tt>Yuml</tt> (\u0178).
     */
    public static final char Yuml = '\u0178';

    /**
     * Unicode character for entity <tt>circ</tt> (\u02c6).
     */
    public static final char circ = '\u02c6';

    /**
     * Unicode character for entity <tt>tilde</tt> (\u02dc).
     */
    public static final char tilde = '\u02dc';

    /**
     * Unicode character for entity <tt>ensp</tt> (\u2002).
     */
    public static final char ensp = '\u2002';

    /**
     * Unicode character for entity <tt>emsp</tt> (\u2003).
     */
    public static final char emsp = '\u2003';

    /**
     * Unicode character for entity <tt>thinsp</tt> (\u2009).
     */
    public static final char thinsp = '\u2009';

    /**
     * Unicode character for entity <tt>zwnj</tt> (\u200c).
     */
    public static final char zwnj = '\u200c';

    /**
     * Unicode character for entity <tt>zwj</tt> (\u200d).
     */
    public static final char zwj = '\u200d';

    /**
     * Unicode character for entity <tt>lrm</tt> (\u200e).
     */
    public static final char lrm = '\u200e';

    /**
     * Unicode character for entity <tt>rlm</tt> (\u200f).
     */
    public static final char rlm = '\u200f';

    /**
     * Unicode character for entity <tt>ndash</tt> (\u2013).
     */
    public static final char ndash = '\u2013';

    /**
     * Unicode character for entity <tt>mdash</tt> (\u2014).
     */
    public static final char mdash = '\u2014';

    /**
     * Unicode character for entity <tt>lsquo</tt> (\u2018).
     */
    public static final char lsquo = '\u2018';

    /**
     * Unicode character for entity <tt>rsquo</tt> (\u2019).
     */
    public static final char rsquo = '\u2019';

    /**
     * Unicode character for entity <tt>sbquo</tt> (\u201a).
     */
    public static final char sbquo = '\u201a';

    /**
     * Unicode character for entity <tt>ldquo</tt> (\u201c).
     */
    public static final char ldquo = '\u201c';

    /**
     * Unicode character for entity <tt>rdquo</tt> (\u201d).
     */
    public static final char rdquo = '\u201d';

    /**
     * Unicode character for entity <tt>bdquo</tt> (\u201e).
     */
    public static final char bdquo = '\u201e';

    /**
     * Unicode character for entity <tt>dagger</tt> (\u2020).
     */
    public static final char dagger = '\u2020';

    /**
     * Unicode character for entity <tt>Dagger</tt> (\u2021).
     */
    public static final char Dagger = '\u2021';

    /**
     * Unicode character for entity <tt>permil</tt> (\u2030).
     */
    public static final char permil = '\u2030';

    /**
     * Unicode character for entity <tt>lsaquo</tt> (\u2039).
     */
    public static final char lsaquo = '\u2039';

    /**
     * Unicode character for entity <tt>rsaquo</tt> (\u203a).
     */
    public static final char rsaquo = '\u203a';

    /**
     * Unicode character for entity <tt>euro</tt> (\u20ac).
     */
    public static final char euro = '\u20ac';

    /**
     * Prevent instanciation.
     */
    private HTMLEntities() {
    }

    /**
     * Convert a text character to an entity name.  This does
     * not include newer character entities that are not supported
     * by HTML 3.2 browsers.
     *
     * @return The entity name or null if there is no entity for the
     *  character.
     */
    public static final String charToEntity(char textChar) {
        switch (textChar) {
        //
        // Character entity references for markup-significant
        //
        case '\u0022': return "quot";
        case '\u0026': return "amp";
        case '\u003c': return "lt";
        case '\u003e': return "gt";
        case '\u00a0': return "nbsp";
        //
        // Character entity references for ISO 8859-1 characters
        //
        case '\u00a1': return "iexcl";
        case '\u00a2': return "cent";
        case '\u00a3': return "pound";
        case '\u00a4': return "curren";
        case '\u00a5': return "yen";
        case '\u00a6': return "brvbar";
        case '\u00a7': return "sect";
        case '\u00a8': return "uml";
        case '\u00a9': return "copy";
        case '\u00aa': return "ordf";
        case '\u00ab': return "laquo";
        case '\u00ac': return "not";
        case '\u00ad': return "shy";
        case '\u00ae': return "reg";
        case '\u00af': return "macr";
        case '\u00b0': return "deg";
        case '\u00b1': return "plusmn";
        case '\u00b2': return "sup2";
        case '\u00b3': return "sup3";
        case '\u00b4': return "acute";
        case '\u00b5': return "micro";
        case '\u00b6': return "para";
        case '\u00b7': return "middot";
        case '\u00b8': return "cedil";
        case '\u00b9': return "sup1";
        case '\u00ba': return "ordm";
        case '\u00bb': return "raquo";
        case '\u00bc': return "frac14";
        case '\u00bd': return "frac12";
        case '\u00be': return "frac34";
        case '\u00bf': return "iquest";
        case '\u00c0': return "Agrave";
        case '\u00c1': return "Aacute";
        case '\u00c2': return "Acirc";
        case '\u00c3': return "Atilde";
        case '\u00c4': return "Auml";
        case '\u00c5': return "Aring";
        case '\u00c6': return "AElig";
        case '\u00c7': return "Ccedil";
        case '\u00c8': return "Egrave";
        case '\u00c9': return "Eacute";
        case '\u00ca': return "Ecirc";
        case '\u00cb': return "Euml";
        case '\u00cc': return "Igrave";
        case '\u00cd': return "Iacute";
        case '\u00ce': return "Icirc";
        case '\u00cf': return "Iuml";
        case '\u00d0': return "ETH";
        case '\u00d1': return "Ntilde";
        case '\u00d2': return "Ograve";
        case '\u00d3': return "Oacute";
        case '\u00d4': return "Ocirc";
        case '\u00d5': return "Otilde";
        case '\u00d6': return "Ouml";
        case '\u00d7': return "times";
        case '\u00d8': return "Oslash";
        case '\u00d9': return "Ugrave";
        case '\u00da': return "Uacute";
        case '\u00db': return "Ucirc";
        case '\u00dc': return "Uuml";
        case '\u00dd': return "Yacute";
        case '\u00de': return "THORN";
        case '\u00df': return "szlig";
        case '\u00e0': return "agrave";
        case '\u00e1': return "aacute";
        case '\u00e2': return "acirc";
        case '\u00e3': return "atilde";
        case '\u00e4': return "auml";
        case '\u00e5': return "aring";
        case '\u00e6': return "aelig";
        case '\u00e7': return "ccedil";
        case '\u00e8': return "egrave";
        case '\u00e9': return "eacute";
        case '\u00ea': return "ecirc";
        case '\u00eb': return "euml";
        case '\u00ec': return "igrave";
        case '\u00ed': return "iacute";
        case '\u00ee': return "icirc";
        case '\u00ef': return "iuml";
        case '\u00f0': return "eth";
        case '\u00f1': return "ntilde";
        case '\u00f2': return "ograve";
        case '\u00f3': return "oacute";
        case '\u00f4': return "ocirc";
        case '\u00f5': return "otilde";
        case '\u00f6': return "ouml";
        case '\u00f7': return "divide";
        case '\u00f8': return "oslash";
        case '\u00f9': return "ugrave";
        case '\u00fa': return "uacute";
        case '\u00fb': return "ucirc";
        case '\u00fc': return "uuml";
        case '\u00fd': return "yacute";
        case '\u00fe': return "thorn";
        case '\u00ff': return "yuml";
        default:
            return null;
        }
    }

    /**
     * Convert a text character to a HTML 4.0 entity name.
     * THis includes newer character entities that are not supported
     * by HTML 3.2 browsers.
     *
     * @return The entity name or null if there is no entity for the
     *  character.
     */
    public static String charToEntity4(char textChar) {
        String charStr = charToEntity(textChar);
        if (charStr != null) {
            return charStr;
        }
        switch (textChar) {
        //
        // Character entity references for symbols, mathematical symbols, and Greek letters
        //
        // Latin Extended
        case '\u0192': return "fnof";
        //
        // Greek
        case '\u0391': return "Alpha";
        case '\u0392': return "Beta";
        case '\u0393': return "Gamma";
        case '\u0394': return "Delta";
        case '\u0395': return "Epsilon";
        case '\u0396': return "Zeta";
        case '\u0397': return "Eta";
        case '\u0398': return "Theta";
        case '\u0399': return "Iota";
        case '\u039a': return "Kappa";
        case '\u039b': return "Lambda";
        case '\u039c': return "Mu";
        case '\u039d': return "Nu";
        case '\u039e': return "Xi";
        case '\u039f': return "Omicron";
        case '\u03a0': return "Pi";
        case '\u03a1': return "Rho";
        case '\u03a3': return "Sigma";
        case '\u03a4': return "Tau";
        case '\u03a5': return "Upsilon";
        case '\u03a6': return "Phi";
        case '\u03a7': return "Chi";
        case '\u03a8': return "Psi";
        case '\u03a9': return "Omega";
        case '\u03b1': return "alpha";
        case '\u03b2': return "beta";
        case '\u03b3': return "gamma";
        case '\u03b4': return "delta";
        case '\u03b5': return "epsilon";
        case '\u03b6': return "zeta";
        case '\u03b7': return "eta";
        case '\u03b8': return "theta";
        case '\u03b9': return "iota";
        case '\u03ba': return "kappa";
        case '\u03bb': return "lambda";
        case '\u03bc': return "mu";
        case '\u03bd': return "nu";
        case '\u03be': return "xi";
        case '\u03bf': return "omicron";
        case '\u03c0': return "pi";
        case '\u03c1': return "rho";
        case '\u03c2': return "sigmaf";
        case '\u03c3': return "sigma";
        case '\u03c4': return "tau";
        case '\u03c5': return "upsilon";
        case '\u03c6': return "phi";
        case '\u03c7': return "chi";
        case '\u03c8': return "psi";
        case '\u03c9': return "omega";
        case '\u03d1': return "thetasym";
        case '\u03d2': return "upsih";
        case '\u03d6': return "piv";
        //
        // General Punctuation
        case '\u2022': return "bull";
        case '\u2026': return "hellip";
        case '\u2032': return "prime";
        case '\u2033': return "Prime";
        case '\u203e': return "oline";
        case '\u2044': return "frasl";
        //
        // Letterlike Symbols
        case '\u2118': return "weierp";
        case '\u2111': return "image";
        case '\u211c': return "real";
        case '\u2122': return "trade";
        case '\u2135': return "alefsym";
        //
        // Arrows
        case '\u2190': return "larr";
        case '\u2191': return "uarr";
        case '\u2192': return "rarr";
        case '\u2193': return "darr";
        case '\u2194': return "harr";
        case '\u21b5': return "crarr";
        case '\u21d0': return "lArr";
        case '\u21d1': return "uArr";
        case '\u21d2': return "rArr";
        case '\u21d3': return "dArr";
        case '\u21d4': return "hArr";
        //
        // Mathematical Operators
        case '\u2200': return "forall";
        case '\u2202': return "part";
        case '\u2203': return "exist";
        case '\u2205': return "empty";
        case '\u2207': return "nabla";
        case '\u2208': return "isin";
        case '\u2209': return "notin";
        case '\u220b': return "ni";
        case '\u220f': return "prod";
        case '\u2211': return "sum";
        case '\u2212': return "minus";
        case '\u2217': return "lowast";
        case '\u221a': return "radic";
        case '\u221d': return "prop";
        case '\u221e': return "infin";
        case '\u2220': return "ang";
        case '\u2227': return "and";
        case '\u2228': return "or";
        case '\u2229': return "cap";
        case '\u222a': return "cup";
        case '\u222b': return "int";
        case '\u2234': return "there4";
        case '\u223c': return "sim";
        case '\u2245': return "cong";
        case '\u2248': return "asymp";
        case '\u2260': return "ne";
        case '\u2261': return "equiv";
        case '\u2264': return "le";
        case '\u2265': return "ge";
        case '\u2282': return "sub";
        case '\u2283': return "sup";
        case '\u2284': return "nsub";
        case '\u2286': return "sube";
        case '\u2287': return "supe";
        case '\u2295': return "oplus";
        case '\u2297': return "otimes";
        case '\u22a5': return "perp";
        case '\u22c5': return "sdot";
        //
        // Miscellaneous Technical
        case '\u2308': return "lceil";
        case '\u2309': return "rceil";
        case '\u230a': return "lfloor";
        case '\u230b': return "rfloor";
        case '\u2329': return "lang";
        case '\u232a': return "rang";
        //
        // Geometric Shapes
        case '\u25ca': return "loz";
        //
        // Miscellaneous Symbols
        case '\u2660': return "spades";
        case '\u2663': return "clubs";
        case '\u2665': return "hearts";
        case '\u2666': return "diams";
        //
        // Character entity references for internationalization characters
        //
        // Latin Extended-A
        case '\u0152': return "OElig";
        case '\u0153': return "oelig";
        case '\u0160': return "Scaron";
        case '\u0161': return "scaron";
        case '\u0178': return "Yuml";
        //
        // Spacing Modifier Letters
        case '\u02c6': return "circ";
        case '\u02dc': return "tilde";
        //
        // General Punctuation
        case '\u2002': return "ensp";
        case '\u2003': return "emsp";
        case '\u2009': return "thinsp";
        case '\u200c': return "zwnj";
        case '\u200d': return "zwj";
        case '\u200e': return "lrm";
        case '\u200f': return "rlm";
        case '\u2013': return "ndash";
        case '\u2014': return "mdash";
        case '\u2018': return "lsquo";
        case '\u2019': return "rsquo";
        case '\u201a': return "sbquo";
        case '\u201c': return "ldquo";
        case '\u201d': return "rdquo";
        case '\u201e': return "bdquo";
        case '\u2020': return "dagger";
        case '\u2021': return "Dagger";
        case '\u2030': return "permil";
        case '\u2039': return "lsaquo";
        case '\u203a': return "rsaquo";
        case '\u20ac': return "euro";
        default:
            return null;
        }
    }
}

   
    
    
  








Related examples in the same category

1.Servlet Output HTML Demo
2.Servlet Display Static HTML
3.Prints a conversion table of miles per gallon to kilometers per liter
4.Servlet: Print Table
5.Html utilities
6.Html Parse Servlet
7.Escape and unescape string
8.Escapes newlines, tabs, backslashes, and quotes in the specified string
9.Web Calendar
10.HTML Helper
11.Escape HTML
12.Convert HTML to text
13.Text To HTML
14.Unescape HTML
15.Java object representations of the HTML table structure
16.Entity Decoder
17.Format a color to HTML RGB color format (e.g. #FF0000 for Color.red)
18.Encode special characters and do formatting for HTML output
19.HTML color names
20.Utility methods for dealing with HTML
21.Filter the specified message string for characters that are sensitive in HTML
22.A collection of all character entites defined in the HTML4 standard.
23.Decode an HTML color string like '#F567BA;' into a Color
24.Normalize Post Data
25.Get HTML Color String from Java Color object
26.HTML Decoder
27.HTML Parser
28.HTML color and Java Color
29.HTML form Utilites
30.Html Dimensions
31.break Lines with HTML
32.insert HTML block dynamically
33.Convert an integer to an HTML RGB value
34.Convert to HTML string