﻿/*
HtmlEncode a string 
(== asp HtmlEncode and php htmlentities)

Examples:
with fields:
entityEncode.encodeField('raw','output');

with a string:
document.getElementById("output").value= entityEncode.encode("<hr/>");
*/
var entityEncode= {
  encode: function(source) {
    //loops through string inspecting charCodes and translating
    //returns encoded string 
    var result = '';
    var hash = this.defineEntities();
    for (var i=0; i<source.length; i++) {
        var charCode = source.charCodeAt(i);
        if (hash['#' + charCode])
            result += "&" + hash['#' + charCode].name + ";";
        else if (charCode <= 127)
            result += source.charAt(i); 
        else
            result += '&#' + charCode + ';'; 
    }
    return result; 
  },
  encodeNumeric: function(source) {
    //as encode but just numeric 
    var result = '';
    for (var i=0; i<source.length; i++) {
        var charCode = source.charCodeAt(i);
        if (charCode <= 127)
            result += source.charAt(i); 
        else
            result += '&#' + charCode + ';'; 
    }
    return result; 
  },
  encodeField: function(sourceId, resultId) {
    //a simple helper for an input field or textarea
    //simple error trapping that ids are found
    var source= document.getElementById(sourceId);
    var result= document.getElementById(resultId);
    if (source == null) return false;
    if (result == null) return false;
    result.value= entityEncode.encode(source.value);
    return true;
  },
  encodeFieldNumeric: function(sourceId, resultId) {
    //version of encodeField for numeric encode
    var source= document.getElementById(sourceId);
    var result= document.getElementById(resultId);
    if (source == null) return false;
    if (result == null) return false;
    result.value= entityEncode.encodeNumeric(source.value);
    return true;
  },
  defineEntities: function() {
    //builds a massive hashtable of all entities (the hash is on #number)
    //an object not an array as prototype.js breaks for-loops (not used here, but hey)
    var hash = new Object();
    var hashItem = { name: 'nbsp', numeric: '#160'}; //nbsp
    hash['#160'] = hashItem; //non-breaking space
    hashItem = { name: 'iexcl', numeric: '#161'}; //iexcl
    hash['#161'] = hashItem; //inverted exclamation mark
    hashItem = { name: 'cent', numeric: '#162'}; //cent
    hash['#162'] = hashItem; //cent sign
    hashItem = { name: 'pound', numeric: '#163'}; //pound
    hash['#163'] = hashItem; //pound sign
    hashItem = { name: 'curren', numeric: '#164'}; //curren
    hash['#164'] = hashItem; // currency sign
    hashItem = { name: 'yen', numeric: '#165'}; //yen
    hash['#165'] = hashItem; //yen sign
    hashItem = { name: 'brvbar', numeric: '#166'}; //brvbar
    hash['#166'] = hashItem; //broken bar
    hashItem = { name: 'sect', numeric: '#167'}; //sect
    hash['#167'] = hashItem; //section sign
    hashItem = { name: 'uml', numeric: '#168'}; //uml
    hash['#168'] = hashItem; //diaeresis
    hashItem = { name: 'copy', numeric: '#169'}; //copy
    hash['#169'] = hashItem; //copyright sign
    hashItem = { name: 'ordf', numeric: '#170'}; //ordf
    hash['#170'] = hashItem; //feminine ordinal indicator
    hashItem = { name: 'laquo', numeric: '#171'}; //laquo
    hash['#171'] = hashItem; //left-pointing double angle quotation mark
    hashItem = { name: 'not', numeric: '#172'}; //not
    hash['#172'] = hashItem; //not sign
    hashItem = { name: 'shy', numeric: '#173'}; //shy
    hash['#173'] = hashItem; //soft hyphen
    hashItem = { name: 'reg', numeric: '#174'}; //reg
    hash['#174'] = hashItem; //registered sign
    hashItem = { name: 'macr', numeric: '#175'}; //macr
    hash['#175'] = hashItem; //macron
    hashItem = { name: 'deg', numeric: '#176'}; //deg
    hash['#176'] = hashItem; //degree sign
    hashItem = { name: 'plusmn', numeric: '#177'}; //plusmn
    hash['#177'] = hashItem; //plus-minus sign
    hashItem = { name: 'sup2', numeric: '#178'}; //sup2
    hash['#178'] = hashItem; //superscript two
    hashItem = { name: 'sup3', numeric: '#179'}; //sup3
    hash['#179'] = hashItem; //superscript three
    hashItem = { name: 'acute', numeric: '#180'}; //acute
    hash['#180'] = hashItem; //acute accent
    hashItem = { name: 'micro', numeric: '#181'}; //micro
    hash['#181'] = hashItem; //micro sign
    hashItem = { name: 'para', numeric: '#182'}; //para
    hash['#182'] = hashItem; //pilcrow sign
    hashItem = { name: 'middot', numeric: '#183'}; //middot
    hash['#183'] = hashItem; //middle dot
    hashItem = { name: 'cedil', numeric: '#184'}; //cedil
    hash['#184'] = hashItem; //cedilla
    hashItem = { name: 'sup1', numeric: '#185'}; //sup1
    hash['#185'] = hashItem; //superscript one
    hashItem = { name: 'ordm', numeric: '#186'}; //ordm
    hash['#186'] = hashItem; //masculine ordinal indicator
    hashItem = { name: 'raquo', numeric: '#187'}; //raquo
    hash['#187'] = hashItem; //right-pointing double angle quotation mark
    hashItem = { name: 'frac14', numeric: '#188'}; //frac14
    hash['#188'] = hashItem; //vulgar fraction one quarter
    hashItem = { name: 'frac12', numeric: '#189'}; //frac12
    hash['#189'] = hashItem; //vulgar fraction one half
    hashItem = { name: 'frac34', numeric: '#190'}; //frac34
    hash['#190'] = hashItem; //vulgar fraction three quarters
    hashItem = { name: 'iquest', numeric: '#191'}; //iquest
    hash['#191'] = hashItem; //inverted question mark
    hashItem = { name: 'Agrave', numeric: '#192'}; //Agrave
    hash['#192'] = hashItem; //latin capital letter A with grave
    hashItem = { name: 'Aacute', numeric: '#193'}; //Aacute
    hash['#193'] = hashItem; //latin capital letter A with acute
    hashItem = { name: 'Acirc', numeric: '#194'}; //Acirc
    hash['#194'] = hashItem; //latin capital letter A with circumflex
    hashItem = { name: 'Atilde', numeric: '#195'}; //Atilde
    hash['#195'] = hashItem; //latin capital letter A with tilde
    hashItem = { name: 'Auml', numeric: '#196'}; //Auml
    hash['#196'] = hashItem; // latin capital letter A with diaeresis
    hashItem = { name: 'Aring', numeric: '#197'}; //Aring
    hash['#197'] = hashItem; //latin capital letter A with ring above
    hashItem = { name: 'AElig', numeric: '#198'}; //AElig
    hash['#198'] = hashItem; //latin capital letter AE
    hashItem = { name: 'Ccedil', numeric: '#199'}; //Ccedil
    hash['#199'] = hashItem; //latin capital letter C with cedilla
    hashItem = { name: 'Egrave', numeric: '#200'}; //Egrave
    hash['#200'] = hashItem; //latin capital letter E with grave
    hashItem = { name: 'Eacute', numeric: '#201'}; //Eacute
    hash['#201'] = hashItem; //latin capital letter E with acute
    hashItem = { name: 'Ecirc', numeric: '#202'}; //Ecirc
    hash['#202'] = hashItem; //latin capital letter E with circumflex
    hashItem = { name: 'Euml', numeric: '#203'}; //Euml
    hash['#203'] = hashItem; //latin capital letter E with diaeresis
    hashItem = { name: 'Igrave', numeric: '#204'}; //Igrave
    hash['#204'] = hashItem; //latin capital letter I with grave
    hashItem = { name: 'Iacute', numeric: '#205'}; //Iacute
    hash['#205'] = hashItem; //latin capital letter I with acute
    hashItem = { name: 'Icirc', numeric: '#206'}; //Icirc
    hash['#206'] = hashItem; //latin capital letter I with circumflex
    hashItem = { name: 'Iuml', numeric: '#207'}; //Iuml
    hash['#207'] = hashItem; //latin capital letter I with diaeresis
    hashItem = { name: 'ETH', numeric: '#208'}; //ETH
    hash['#208'] = hashItem; //latin capital letter ETH
    hashItem = { name: 'Ntilde', numeric: '#209'}; //Ntilde
    hash['#209'] = hashItem; //latin capital letter N with tilde
    hashItem = { name: 'Ograve', numeric: '#210'}; //Ograve
    hash['#210'] = hashItem; //latin capital letter O with grave
    hashItem = { name: 'Oacute', numeric: '#211'}; //Oacute
    hash['#211'] = hashItem; //latin capital letter O with acute
    hashItem = { name: 'Ocirc', numeric: '#212'}; //Ocirc
    hash['#212'] = hashItem; //latin capital letter O with circumflex
    hashItem = { name: 'Otilde', numeric: '#213'}; //Otilde
    hash['#213'] = hashItem; //latin capital letter O with tilde
    hashItem = { name: 'Ouml', numeric: '#214'}; //Ouml
    hash['#214'] = hashItem; //latin capital letter O with diaeresis
    hashItem = { name: 'times', numeric: '#215'}; //times
    hash['#215'] = hashItem; //multiplication sign
    hashItem = { name: 'Oslash', numeric: '#216'}; //Oslash
    hash['#216'] = hashItem; //latin capital letter O with stroke
    hashItem = { name: 'Ugrave', numeric: '#217'}; //Ugrave
    hash['#217'] = hashItem; //latin capital letter U with grave
    hashItem = { name: 'Uacute', numeric: '#218'}; //Uacute
    hash['#218'] = hashItem; //latin capital letter U with acute
    hashItem = { name: 'Ucirc', numeric: '#219'}; //Ucirc
    hash['#219'] = hashItem; //latin capital letter U with circumflex
    hashItem = { name: 'Uuml', numeric: '#220'}; //Uuml
    hash['#220'] = hashItem; //latin capital letter U with diaeresis
    hashItem = { name: 'Yacute', numeric: '#221'}; //Yacute
    hash['#221'] = hashItem; //latin capital letter Y with acute
    hashItem = { name: 'THORN', numeric: '#222'}; //THORN
    hash['#222'] = hashItem; //latin capital letter THORN
    hashItem = { name: 'szlig', numeric: '#223'}; //szlig
    hash['#223'] = hashItem; //latin small letter sharp s
    hashItem = { name: 'agrave', numeric: '#224'}; //agrave
    hash['#224'] = hashItem; //latin small letter a with grave
    hashItem = { name: 'aacute', numeric: '#225'}; //aacute
    hash['#225'] = hashItem; // latin small letter a with acute
    hashItem = { name: 'acirc', numeric: '#226'}; //acirc
    hash['#226'] = hashItem; //latin small letter a with circumflex
    hashItem = { name: 'atilde', numeric: '#227'}; //atilde
    hash['#227'] = hashItem; //latin small letter a with tilde
    hashItem = { name: 'auml', numeric: '#228'}; //auml
    hash['#228'] = hashItem; //latin small letter a with diaeresis
    hashItem = { name: 'aring', numeric: '#229'}; //aring
    hash['#229'] = hashItem; //latin small letter a with ring above
    hashItem = { name: 'aelig', numeric: '#230'}; //aelig
    hash['#230'] = hashItem; //latin small letter ae
    hashItem = { name: 'ccedil', numeric: '#231'}; //ccedil
    hash['#231'] = hashItem; //latin small letter c with cedilla
    hashItem = { name: 'egrave', numeric: '#232'}; //egrave
    hash['#232'] = hashItem; //latin small letter e with grave
    hashItem = { name: 'eacute', numeric: '#233'}; //eacute
    hash['#233'] = hashItem; //latin small letter e with acute
    hashItem = { name: 'ecirc', numeric: '#234'}; //ecirc
    hash['#234'] = hashItem; //latin small letter e with circumflex
    hashItem = { name: 'euml', numeric: '#235'}; //euml
    hash['#235'] = hashItem; //latin small letter e with diaeresis
    hashItem = { name: 'igrave', numeric: '#236'}; //igrave
    hash['#236'] = hashItem; //latin small letter i with grave
    hashItem = { name: 'iacute', numeric: '#237'}; //iacute
    hash['#237'] = hashItem; //latin small letter i with acute
    hashItem = { name: 'icirc', numeric: '#238'}; //icirc
    hash['#238'] = hashItem; //latin small letter i with circumflex
    hashItem = { name: 'iuml', numeric: '#239'}; //iuml
    hash['#239'] = hashItem; //latin small letter i with diaeresis
    hashItem = { name: 'eth', numeric: '#240'}; //eth
    hash['#240'] = hashItem; //latin small letter eth
    hashItem = { name: 'ntilde', numeric: '#241'}; //ntilde
    hash['#241'] = hashItem; //latin small letter n with tilde
    hashItem = { name: 'ograve', numeric: '#242'}; //ograve
    hash['#242'] = hashItem; //latin small letter o with grave
    hashItem = { name: 'oacute', numeric: '#243'}; //oacute
    hash['#243'] = hashItem; //latin small letter o with acute
    hashItem = { name: 'ocirc', numeric: '#244'}; //ocirc
    hash['#244'] = hashItem; //latin small letter o with circumflex
    hashItem = { name: 'otilde', numeric: '#245'}; //otilde
    hash['#245'] = hashItem; //latin small letter o with tilde
    hashItem = { name: 'ouml', numeric: '#246'}; //ouml
    hash['#246'] = hashItem; //latin small letter o with diaeresis
    hashItem = { name: 'divide', numeric: '#247'}; //divide
    hash['#247'] = hashItem; //division sign
    hashItem = { name: 'oslash', numeric: '#248'}; //oslash
    hash['#248'] = hashItem; //latin small letter o with stroke
    hashItem = { name: 'ugrave', numeric: '#249'}; //ugrave
    hash['#249'] = hashItem; //latin small letter u with grave
    hashItem = { name: 'uacute', numeric: '#250'}; //uacute
    hash['#250'] = hashItem; //latin small letter u with acute
    hashItem = { name: 'ucirc', numeric: '#251'}; //ucirc
    hash['#251'] = hashItem; //latin small letter u with circumflex
    hashItem = { name: 'uuml', numeric: '#252'}; //uuml
    hash['#252'] = hashItem; //latin small letter u with diaeresis
    hashItem = { name: 'yacute', numeric: '#253'}; //yacute
    hash['#253'] = hashItem; //latin small letter y with acute
    hashItem = { name: 'thorn', numeric: '#254'}; //thorn
    hash['#254'] = hashItem; //latin small letter thorn
    hashItem = { name: 'yuml', numeric: '#255'}; //yuml
    hash['#255'] = hashItem; //latin small letter y with diaeresis
    hashItem = { name: 'Alpha', numeric: '#913'}; //Alpha
    hash['#913'] = hashItem; //greek capital letter alpha
    hashItem = { name: 'Beta', numeric: '#914'}; //Beta
    hash['#914'] = hashItem; //greek capital letter beta
    hashItem = { name: 'Gamma', numeric: '#915'}; //Gamma
    hash['#915'] = hashItem; //greek capital letter gamma
    hashItem = { name: 'Delta', numeric: '#916'}; //Delta
    hash['#916'] = hashItem; //greek capital letter delta
    hashItem = { name: 'Epsilon', numeric: '#917'}; //Epsilon
    hash['#917'] = hashItem; //greek capital letter epsilon
    hashItem = { name: 'Zeta', numeric: '#918'}; //Zeta
    hash['#918'] = hashItem; //greek capital letter zeta
    hashItem = { name: 'Eta', numeric: '#919'}; //Eta
    hash['#919'] = hashItem; //greek capital letter eta
    hashItem = { name: 'Theta', numeric: '#920'}; //Theta
    hash['#920'] = hashItem; //greek capital letter theta
    hashItem = { name: 'Iota', numeric: '#921'}; //Iota
    hash['#921'] = hashItem; //greek capital letter iota
    hashItem = { name: 'Kappa', numeric: '#922'}; //Kappa
    hash['#922'] = hashItem; //greek capital letter kappa
    hashItem = { name: 'Lambda', numeric: '#923'}; //Lambda
    hash['#923'] = hashItem; //greek capital letter lambda
    hashItem = { name: 'Mu', numeric: '#924'}; //Mu
    hash['#924'] = hashItem; //greek capital letter mu
    hashItem = { name: 'Nu', numeric: '#925'}; //Nu
    hash['#925'] = hashItem; //greek capital letter nu
    hashItem = { name: 'Xi', numeric: '#926'}; //Xi
    hash['#926'] = hashItem; //greek capital letter xi
    hashItem = { name: 'Omicron', numeric: '#927'}; //Omicron
    hash['#927'] = hashItem; //greek capital letter omicron
    hashItem = { name: 'Pi', numeric: '#928'}; //Pi
    hash['#928'] = hashItem; //greek capital letter pi
    hashItem = { name: 'Rho', numeric: '#929'}; //Rho
    hash['#929'] = hashItem; //greek capital letter rho
    hashItem = { name: 'Sigma', numeric: '#931'}; //Sigma
    hash['#931'] = hashItem; //greek capital letter sigma
    hashItem = { name: 'Tau', numeric: '#932'}; //Tau
    hash['#932'] = hashItem; //greek capital letter tau
    hashItem = { name: 'Upsilon', numeric: '#933'}; //Upsilon
    hash['#933'] = hashItem; //greek capital letter upsilon
    hashItem = { name: 'Phi', numeric: '#934'}; //Phi
    hash['#934'] = hashItem; //greek capital letter phi
    hashItem = { name: 'Chi', numeric: '#935'}; //Chi
    hash['#935'] = hashItem; //greek capital letter chi
    hashItem = { name: 'Psi', numeric: '#936'}; //Psi
    hash['#936'] = hashItem; //greek capital letter psi
    hashItem = { name: 'Omega', numeric: '#937'}; //Omega
    hash['#937'] = hashItem; //greek capital letter omega
    hashItem = { name: 'alpha', numeric: '#945'}; //alpha
    hash['#945'] = hashItem; //greek small letter alpha
    hashItem = { name: 'beta', numeric: '#946'}; //beta
    hash['#946'] = hashItem; //greek small letter beta
    hashItem = { name: 'gamma', numeric: '#947'}; //gamma
    hash['#947'] = hashItem; //greek small letter gamma
    hashItem = { name: 'delta', numeric: '#948'}; //delta
    hash['#948'] = hashItem; //greek small letter delta
    hashItem = { name: 'epsilon', numeric: '#949'}; //epsilon
    hash['#949'] = hashItem; //greek small letter epsilon
    hashItem = { name: 'zeta', numeric: '#950'}; //zeta
    hash['#950'] = hashItem; //greek small letter zeta
    hashItem = { name: 'eta', numeric: '#951'}; //eta
    hash['#951'] = hashItem; //greek small letter eta
    hashItem = { name: 'theta', numeric: '#952'}; //theta
    hash['#952'] = hashItem; //greek small letter theta
    hashItem = { name: 'iota', numeric: '#953'}; //iota
    hash['#953'] = hashItem; //greek small letter iota
    hashItem = { name: 'kappa', numeric: '#954'}; //kappa
    hash['#954'] = hashItem; //greek small letter kappa
    hashItem = { name: 'lambda', numeric: '#955'}; //lambda
    hash['#955'] = hashItem; //greek small letter lambda
    hashItem = { name: 'mu', numeric: '#956'}; //mu
    hash['#956'] = hashItem; //greek small letter mu
    hashItem = { name: 'nu', numeric: '#957'}; //nu
    hash['#957'] = hashItem; //greek small letter nu
    hashItem = { name: 'xi', numeric: '#958'}; //xi
    hash['#958'] = hashItem; //greek small letter xi
    hashItem = { name: 'omicron', numeric: '#959'}; //omicron
    hash['#959'] = hashItem; //greek small letter omicron
    hashItem = { name: 'pi', numeric: '#960'}; //pi
    hash['#960'] = hashItem; //greek small letter pi
    hashItem = { name: 'rho', numeric: '#961'}; //rho
    hash['#961'] = hashItem; //greek small letter rho
    hashItem = { name: 'sigmaf', numeric: '#962'}; //sigmaf
    hash['#962'] = hashItem; //greek small letter final sigma
    hashItem = { name: 'sigma', numeric: '#963'}; //sigma
    hash['#963'] = hashItem; //greek small letter sigma
    hashItem = { name: 'tau', numeric: '#964'}; //tau
    hash['#964'] = hashItem; //greek small letter tau
    hashItem = { name: 'upsilon', numeric: '#965'}; //upsilon
    hash['#965'] = hashItem; //greek small letter upsilon
    hashItem = { name: 'phi', numeric: '#966'}; //phi
    hash['#966'] = hashItem; //greek small letter phi
    hashItem = { name: 'chi', numeric: '#967'}; //chi
    hash['#967'] = hashItem; //greek small letter chi
    hashItem = { name: 'psi', numeric: '#968'}; //psi
    hash['#968'] = hashItem; //greek small letter psi
    hashItem = { name: 'omega', numeric: '#969'}; //omega
    hash['#969'] = hashItem; //greek small letter omega
    hashItem = { name: 'thetasym', numeric: '#977'}; //thetasym
    hash['#977'] = hashItem; //greek small letter theta symbol
    hashItem = { name: 'upsih', numeric: '#978'}; //upsih
    hash['#978'] = hashItem; //greek upsilon with hook symbol
    hashItem = { name: 'piv', numeric: '#982'}; //piv
    hash['#982'] = hashItem; //greek pi symbol
    hashItem = { name: 'bull', numeric: '#8226'}; //bull
    hash['#8226'] = hashItem; //bullet
    hashItem = { name: 'hellip', numeric: '#8230'}; //hellip
    hash['#8230'] = hashItem; //horizontal ellipsis
    hashItem = { name: 'prime', numeric: '#8242'}; //prime
    hash['#8242'] = hashItem; //primeminutes
    hashItem = { name: 'Prime', numeric: '#8243'}; //Prime
    hash['#8243'] = hashItem; //double prime
    hashItem = { name: 'oline', numeric: '#8254'}; //oline
    hash['#8254'] = hashItem; //overline
    hashItem = { name: 'frasl', numeric: '#8260'}; //frasl
    hash['#8260'] = hashItem; //fraction slash
    hashItem = { name: 'weierp', numeric: '#8472'}; //weierp
    hash['#8472'] = hashItem; //script capital P
    hashItem = { name: 'image', numeric: '#8465'}; //image
    hash['#8465'] = hashItem; //blackletter capital I
    hashItem = { name: 'real', numeric: '#8476'}; //real
    hash['#8476'] = hashItem; //blackletter capital R
    hashItem = { name: 'trade', numeric: '#8482'}; //trade
    hash['#8482'] = hashItem; //trade mark sign
    hashItem = { name: 'alefsym', numeric: '#8501'}; //alefsym
    hash['#8501'] = hashItem; //alef symbol
    hashItem = { name: 'larr', numeric: '#8592'}; //larr
    hash['#8592'] = hashItem; //leftwards arrow
    hashItem = { name: 'uarr', numeric: '#8593'}; //uarr
    hash['#8593'] = hashItem; //upwards arrow
    hashItem = { name: 'rarr', numeric: '#8594'}; //rarr
    hash['#8594'] = hashItem; //rightwards arrow
    hashItem = { name: 'darr', numeric: '#8595'}; //darr
    hash['#8595'] = hashItem; //downwards arrow
    hashItem = { name: 'harr', numeric: '#8596'}; //harr
    hash['#8596'] = hashItem; //left right arrow
    hashItem = { name: 'crarr', numeric: '#8629'}; //crarr
    hash['#8629'] = hashItem; //downwards arrow with corner leftwards
    hashItem = { name: 'lArr', numeric: '#8656'}; //lArr
    hash['#8656'] = hashItem; //leftwards double arrow
    hashItem = { name: 'uArr', numeric: '#8657'}; //uArr
    hash['#8657'] = hashItem; //upwards double arrow
    hashItem = { name: 'rArr', numeric: '#8658'}; //rArr
    hash['#8658'] = hashItem; //rightwards double arrow
    hashItem = { name: 'dArr', numeric: '#8659'}; //dArr
    hash['#8659'] = hashItem; //downwards double arrow
    hashItem = { name: 'hArr', numeric: '#8660'}; //hArr
    hash['#8660'] = hashItem; //left right double arrow
    hashItem = { name: 'forall', numeric: '#8704'}; //forall
    hash['#8704'] = hashItem; //for all
    hashItem = { name: 'part', numeric: '#8706'}; //part
    hash['#8706'] = hashItem; //partial differential
    hashItem = { name: 'exist', numeric: '#8707'}; //exist
    hash['#8707'] = hashItem; //there exists
    hashItem = { name: 'empty', numeric: '#8709'}; //empty
    hash['#8709'] = hashItem; //empty set
    hashItem = { name: 'nabla', numeric: '#8711'}; //nabla
    hash['#8711'] = hashItem; //nabla
    hashItem = { name: 'isin', numeric: '#8712'}; //isin
    hash['#8712'] = hashItem; //element of
    hashItem = { name: 'notin', numeric: '#8713'}; //notin
    hash['#8713'] = hashItem; //not an element of
    hashItem = { name: 'ni', numeric: '#8715'}; //ni
    hash['#8715'] = hashItem; //contains as member
    hashItem = { name: 'prod', numeric: '#8719'}; //prod
    hash['#8719'] = hashItem; //n-ary product
    hashItem = { name: 'sum', numeric: '#8721'}; //sum
    hash['#8721'] = hashItem; //n-ary sumation
    hashItem = { name: 'minus', numeric: '#8722'}; //minus
    hash['#8722'] = hashItem; //minus sign
    hashItem = { name: 'lowast', numeric: '#8727'}; //lowast
    hash['#8727'] = hashItem; //asterisk operator
    hashItem = { name: 'radic', numeric: '#8730'}; //radic
    hash['#8730'] = hashItem; //square root
    hashItem = { name: 'prop', numeric: '#8733'}; //prop
    hash['#8733'] = hashItem; //proportional to
    hashItem = { name: 'infin', numeric: '#8734'}; //infin
    hash['#8734'] = hashItem; //infinity
    hashItem = { name: 'ang', numeric: '#8736'}; //ang
    hash['#8736'] = hashItem; //angle
    hashItem = { name: 'and', numeric: '#8743'}; //and
    hash['#8743'] = hashItem; //logical and
    hashItem = { name: 'or', numeric: '#8744'}; //or
    hash['#8744'] = hashItem; //logical or
    hashItem = { name: 'cap', numeric: '#8745'}; //cap
    hash['#8745'] = hashItem; //intersection
    hashItem = { name: 'cup', numeric: '#8746'}; //cup
    hash['#8746'] = hashItem; //union
    hashItem = { name: 'int', numeric: '#8747'}; //int
    hash['#8747'] = hashItem; //integral
    hashItem = { name: 'there4', numeric: '#8756'}; //there4
    hash['#8756'] = hashItem; //therefore
    hashItem = { name: 'sim', numeric: '#8764'}; //sim
    hash['#8764'] = hashItem; //tilde operator
    hashItem = { name: 'cong', numeric: '#8773'}; //cong
    hash['#8773'] = hashItem; //approximately equal to
    hashItem = { name: 'asymp', numeric: '#8776'}; //asymp
    hash['#8776'] = hashItem; //almost equal to
    hashItem = { name: 'ne', numeric: '#8800'}; //ne
    hash['#8800'] = hashItem; //not equal to
    hashItem = { name: 'equiv', numeric: '#8801'}; //equiv
    hash['#8801'] = hashItem; //identical to
    hashItem = { name: 'le', numeric: '#8804'}; //le
    hash['#8804'] = hashItem; //less-than or equal to
    hashItem = { name: 'ge', numeric: '#8805'}; //ge
    hash['#8805'] = hashItem; //greater-than or equal to
    hashItem = { name: 'sub', numeric: '#8834'}; //sub
    hash['#8834'] = hashItem; //subset of
    hashItem = { name: 'sup', numeric: '#8835'}; //sup
    hash['#8835'] = hashItem; //superset of
    hashItem = { name: 'nsub', numeric: '#8836'}; //nsub
    hash['#8836'] = hashItem; //not a subset of
    hashItem = { name: 'sube', numeric: '#8838'}; //sube
    hash['#8838'] = hashItem; //subset of or equal to
    hashItem = { name: 'supe', numeric: '#8839'}; //supe
    hash['#8839'] = hashItem; //superset of or equal to
    hashItem = { name: 'oplus', numeric: '#8853'}; //oplus
    hash['#8853'] = hashItem; //circled plus
    hashItem = { name: 'otimes', numeric: '#8855'}; //otimes
    hash['#8855'] = hashItem; //circled times
    hashItem = { name: 'perp', numeric: '#8869'}; //perp
    hash['#8869'] = hashItem; //up tack
    hashItem = { name: 'sdot', numeric: '#8901'}; //sdot
    hash['#8901'] = hashItem; //dot operator
    hashItem = { name: 'lceil', numeric: '#8968'}; //lceil
    hash['#8968'] = hashItem; //left ceiling
    hashItem = { name: 'rceil', numeric: '#8969'}; //rceil
    hash['#8969'] = hashItem; //right ceiling
    hashItem = { name: 'lfloor', numeric: '#8970'}; //lfloor
    hash['#8970'] = hashItem; //left floor
    hashItem = { name: 'rfloor', numeric: '#8971'}; //rfloor
    hash['#8971'] = hashItem; //right floor
    hashItem = { name: 'lang', numeric: '#9001'}; //lang
    hash['#9001'] = hashItem; //left-pointing angle bracket
    hashItem = { name: 'rang', numeric: '#9002'}; //rang
    hash['#9002'] = hashItem; //right-pointing angle bracket
    hashItem = { name: 'loz', numeric: '#9674'}; //loz
    hash['#9674'] = hashItem; //lozenge
    hashItem = { name: 'spades', numeric: '#9824'}; //spades
    hash['#9824'] = hashItem; //black spade suit
    hashItem = { name: 'clubs', numeric: '#9827'}; //clubs
    hash['#9827'] = hashItem; //black club suit
    hashItem = { name: 'hearts', numeric: '#9829'}; //hearts
    hash['#9829'] = hashItem; //black heart suit
    hashItem = { name: 'diams', numeric: '#9830'}; //diams
    hash['#9830'] = hashItem; //black diamond suit
    hashItem = { name: 'quot', numeric: '#34'}; //quot
    hash['#34'] = hashItem; //quotation mark
    hashItem = { name: 'amp', numeric: '#38'}; //amp
    hash['#38'] = hashItem; //ampersand
    hashItem = { name: 'lt', numeric: '#60'}; //lt
    hash['#60'] = hashItem; //less-than sign
    hashItem = { name: 'gt', numeric: '#62'}; //gt
    hash['#62'] = hashItem; //greater-than sign
    hashItem = { name: 'OElig', numeric: '#338'}; //OElig
    hash['#338'] = hashItem; //latin capital ligature OE
    hashItem = { name: 'oelig', numeric: '#339'}; //oelig
    hash['#339'] = hashItem; //latin small ligature oe
    hashItem = { name: 'Scaron', numeric: '#352'}; //Scaron
    hash['#352'] = hashItem; //latin capital letter S with caron
    hashItem = { name: 'scaron', numeric: '#353'}; //scaron
    hash['#353'] = hashItem; //latin small letter s with caron
    hashItem = { name: 'Yuml', numeric: '#376'}; //Yuml
    hash['#376'] = hashItem; //latin capital letter Y with diaeresis
    hashItem = { name: 'circ', numeric: '#710'}; //circ
    hash['#710'] = hashItem; //modifier letter circumflex accent
    hashItem = { name: 'tilde', numeric: '#732'}; //tilde
    hash['#732'] = hashItem; // small tilde
    hashItem = { name: 'ensp', numeric: '#8194'}; //ensp
    hash['#8194'] = hashItem; //en space
    hashItem = { name: 'emsp', numeric: '#8195'}; //emsp
    hash['#8195'] = hashItem; //em space
    hashItem = { name: 'thinsp', numeric: '#8201'}; //thinsp
    hash['#8201'] = hashItem; //thin space
    hashItem = { name: 'zwnj', numeric: '#8204'}; //zwnj
    hash['#8204'] = hashItem; //zero width non-joiner
    hashItem = { name: 'zwj', numeric: '#8205'}; //zwj
    hash['#8205'] = hashItem; //zero width joiner
    hashItem = { name: 'lrm', numeric: '#8206'}; //lrm
    hash['#8206'] = hashItem; //left-to-right mark
    hashItem = { name: 'rlm', numeric: '#8207'}; //rlm
    hash['#8207'] = hashItem; //right-to-left mark
    hashItem = { name: 'ndash', numeric: '#8211'}; //ndash
    hash['#8211'] = hashItem; //en dash
    hashItem = { name: 'mdash', numeric: '#8212'}; //mdash
    hash['#8212'] = hashItem; // em dash
    hashItem = { name: 'lsquo', numeric: '#8216'}; //lsquo
    hash['#8216'] = hashItem; //left single quotation mark
    hashItem = { name: 'rsquo', numeric: '#8217'}; //rsquo
    hash['#8217'] = hashItem; //right single quotation mark
    hashItem = { name: 'sbquo', numeric: '#8218'}; //sbquo
    hash['#8218'] = hashItem; //single low-9 quotation mark
    hashItem = { name: 'ldquo', numeric: '#8220'}; //ldquo
    hash['#8220'] = hashItem; //left double quotation mark
    hashItem = { name: 'rdquo', numeric: '#8221'}; //rdquo
    hash['#8221'] = hashItem; //right double quotation mark
    hashItem = { name: 'bdquo', numeric: '#8222'}; //bdquo
    hash['#8222'] = hashItem; //double low-9 quotation mark
    hashItem = { name: 'dagger', numeric: '#8224'}; //dagger
    hash['#8224'] = hashItem; // dagger
    hashItem = { name: 'Dagger', numeric: '#8225'}; //Dagger
    hash['#8225'] = hashItem; //double dagger
    hashItem = { name: 'permil', numeric: '#8240'}; //permil
    hash['#8240'] = hashItem; //per mille sign
    hashItem = { name: 'lsaquo', numeric: '#8249'}; //lsaquo
    hash['#8249'] = hashItem; //single left-pointing angle quotation mark
    hashItem = { name: 'rsaquo', numeric: '#8250'}; //rsaquo
    hash['#8250'] = hashItem; //single right-pointing angle quotation mark
    hashItem = { name: 'euro', numeric: '#8364'}; //euro
    hash['#8364'] = hashItem; //euro sign
    return hash;
  }
}