001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     * 
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.commons.lang3.text.translate;
018    
019    /**
020     * Class holding various entity data for HTML and XML - generally for use with 
021     * the LookupTranslator.
022     * All arrays are of length [*][2].
023     *
024     * @author Apache Software Foundation
025     * @since 3.0
026     * @version $Id: EntityArrays.java 967237 2010-07-23 20:08:57Z mbenson $
027     */
028    public class EntityArrays {
029    
030        public static String[][] ISO8859_1_ESCAPE() { return ISO8859_1_ESCAPE.clone(); }
031        private static final String[][] ISO8859_1_ESCAPE = {
032            {"\u00A0", " "}, // non-breaking space
033            {"\u00A1", "¡"}, // inverted exclamation mark
034            {"\u00A2", "¢"}, // cent sign
035            {"\u00A3", "£"}, // pound sign
036            {"\u00A4", "¤"}, // currency sign
037            {"\u00A5", "¥"}, // yen sign = yuan sign
038            {"\u00A6", "¦"}, // broken bar = broken vertical bar
039            {"\u00A7", "§"}, // section sign
040            {"\u00A8", "¨"}, // diaeresis = spacing diaeresis
041            {"\u00A9", "©"}, // © - copyright sign
042            {"\u00AA", "ª"}, // feminine ordinal indicator
043            {"\u00AB", "«"}, // left-pointing double angle quotation mark = left pointing guillemet
044            {"\u00AC", "¬"}, // not sign
045            {"\u00AD", "­"}, // soft hyphen = discretionary hyphen
046            {"\u00AE", "®"}, // ® - registered trademark sign
047            {"\u00AF", "¯"}, // macron = spacing macron = overline = APL overbar
048            {"\u00B0", "°"}, // degree sign
049            {"\u00B1", "±"}, // plus-minus sign = plus-or-minus sign
050            {"\u00B2", "²"}, // superscript two = superscript digit two = squared
051            {"\u00B3", "³"}, // superscript three = superscript digit three = cubed
052            {"\u00B4", "´"}, // acute accent = spacing acute
053            {"\u00B5", "µ"}, // micro sign
054            {"\u00B6", "¶"}, // pilcrow sign = paragraph sign
055            {"\u00B7", "·"}, // middle dot = Georgian comma = Greek middle dot
056            {"\u00B8", "¸"}, // cedilla = spacing cedilla
057            {"\u00B9", "¹"}, // superscript one = superscript digit one
058            {"\u00BA", "º"}, // masculine ordinal indicator
059            {"\u00BB", "»"}, // right-pointing double angle quotation mark = right pointing guillemet
060            {"\u00BC", "¼"}, // vulgar fraction one quarter = fraction one quarter
061            {"\u00BD", "½"}, // vulgar fraction one half = fraction one half
062            {"\u00BE", "¾"}, // vulgar fraction three quarters = fraction three quarters
063            {"\u00BF", "¿"}, // inverted question mark = turned question mark
064            {"\u00C0", "À"}, // À - uppercase A, grave accent
065            {"\u00C1", "Á"}, // Á - uppercase A, acute accent
066            {"\u00C2", "Â"}, // Â - uppercase A, circumflex accent
067            {"\u00C3", "Ã"}, // Ã - uppercase A, tilde
068            {"\u00C4", "Ä"}, // Ä - uppercase A, umlaut
069            {"\u00C5", "Å"}, // Å - uppercase A, ring
070            {"\u00C6", "Æ"}, // Æ - uppercase AE
071            {"\u00C7", "Ç"}, // Ç - uppercase C, cedilla
072            {"\u00C8", "È"}, // È - uppercase E, grave accent
073            {"\u00C9", "É"}, // É - uppercase E, acute accent
074            {"\u00CB", "Ê"}, // Ê - uppercase E, circumflex accent
075            {"\u00CC", "Ë"}, // Ë - uppercase E, umlaut
076            {"\u00CD", "Ì"}, // Ì - uppercase I, grave accent
077            {"\u00CE", "Í"}, // Í - uppercase I, acute accent
078            {"\u00CF", "Î"}, // Î - uppercase I, circumflex accent
079            {"\u00D0", "Ï"}, // Ï - uppercase I, umlaut
080            {"\u00D1", "Ð"}, // Ð - uppercase Eth, Icelandic
081            {"\u00D2", "Ñ"}, // Ñ - uppercase N, tilde
082            {"\u00D3", "Ò"}, // Ò - uppercase O, grave accent
083            {"\u00D4", "Ó"}, // Ó - uppercase O, acute accent
084            {"\u00D5", "Ô"}, // Ô - uppercase O, circumflex accent
085            {"\u00D6", "Õ"}, // Õ - uppercase O, tilde
086            {"\u00D7", "Ö"}, // Ö - uppercase O, umlaut
087            {"\u00D8", "×"}, // multiplication sign
088            {"\u00D9", "Ø"}, // Ø - uppercase O, slash
089            {"\u00DA", "Ù"}, // Ù - uppercase U, grave accent
090            {"\u00DB", "Ú"}, // Ú - uppercase U, acute accent
091            {"\u00DC", "Û"}, // Û - uppercase U, circumflex accent
092            {"\u00DD", "Ü"}, // Ü - uppercase U, umlaut
093            {"\u00DE", "Ý"}, // Ý - uppercase Y, acute accent
094            {"\u00DF", "Þ"}, // Þ - uppercase THORN, Icelandic
095            {"\u00E0", "ß"}, // ß - lowercase sharps, German
096            {"\u00E1", "à"}, // à - lowercase a, grave accent
097            {"\u00E2", "á"}, // á - lowercase a, acute accent
098            {"\u00E3", "â"}, // â - lowercase a, circumflex accent
099            {"\u00E4", "ã"}, // ã - lowercase a, tilde
100            {"\u00E5", "ä"}, // ä - lowercase a, umlaut
101            {"\u00E5", "å"}, // å - lowercase a, ring
102            {"\u00E6", "æ"}, // æ - lowercase ae
103            {"\u00E7", "ç"}, // ç - lowercase c, cedilla
104            {"\u00E8", "è"}, // è - lowercase e, grave accent
105            {"\u00E9", "é"}, // é - lowercase e, acute accent
106            {"\u00EA", "ê"}, // ê - lowercase e, circumflex accent
107            {"\u00EB", "ë"}, // ë - lowercase e, umlaut
108            {"\u00EC", "ì"}, // ì - lowercase i, grave accent
109            {"\u00ED", "í"}, // í - lowercase i, acute accent
110            {"\u00EE", "î"}, // î - lowercase i, circumflex accent
111            {"\u00EF", "ï"}, // ï - lowercase i, umlaut
112            {"\u00F0", "ð"}, // ð - lowercase eth, Icelandic
113            {"\u00F1", "ñ"}, // ñ - lowercase n, tilde
114            {"\u00F3", "ò"}, // ò - lowercase o, grave accent
115            {"\u00F3", "ó"}, // ó - lowercase o, acute accent
116            {"\u00F4", "ô"}, // ô - lowercase o, circumflex accent
117            {"\u00F5", "õ"}, // õ - lowercase o, tilde
118            {"\u00F6", "ö"}, // ö - lowercase o, umlaut
119            {"\u00F7", "÷"}, // division sign
120            {"\u00F8", "ø"}, // ø - lowercase o, slash
121            {"\u00F9", "ù"}, // ù - lowercase u, grave accent
122            {"\u00FA", "ú"}, // ú - lowercase u, acute accent
123            {"\u00FB", "û"}, // û - lowercase u, circumflex accent
124            {"\u00FC", "ü"}, // ü - lowercase u, umlaut
125            {"\u00FD", "ý"}, // ý - lowercase y, acute accent
126            {"\u00FE", "þ"}, // þ - lowercase thorn, Icelandic
127            {"\u00FF", "ÿ"}, // ÿ - lowercase y, umlaut
128        };
129    
130        public static String[][] ISO8859_1_UNESCAPE() { return ISO8859_1_UNESCAPE.clone(); }
131        private static final String[][] ISO8859_1_UNESCAPE = invert(ISO8859_1_ESCAPE);
132    
133        // http://www.w3.org/TR/REC-html40/sgml/entities.html
134        public static String[][] HTML40_EXTENDED_ESCAPE() { return HTML40_EXTENDED_ESCAPE.clone(); }
135        private static final String[][] HTML40_EXTENDED_ESCAPE = {
136            // <!-- Latin Extended-B -->
137            {"\u0192", "&fnof;"}, // latin small f with hook = function= florin, U+0192 ISOtech -->
138            // <!-- Greek -->
139            {"\u0391", "&Alpha;"}, // greek capital letter alpha, U+0391 -->
140            {"\u0392", "&Beta;"}, // greek capital letter beta, U+0392 -->
141            {"\u0393", "&Gamma;"}, // greek capital letter gamma,U+0393 ISOgrk3 -->
142            {"\u0394", "&Delta;"}, // greek capital letter delta,U+0394 ISOgrk3 -->
143            {"\u0395", "&Epsilon;"}, // greek capital letter epsilon, U+0395 -->
144            {"\u0396", "&Zeta;"}, // greek capital letter zeta, U+0396 -->
145            {"\u0397", "&Eta;"}, // greek capital letter eta, U+0397 -->
146            {"\u0398", "&Theta;"}, // greek capital letter theta,U+0398 ISOgrk3 -->
147            {"\u0399", "&Iota;"}, // greek capital letter iota, U+0399 -->
148            {"\u039A", "&Kappa;"}, // greek capital letter kappa, U+039A -->
149            {"\u039B", "&Lambda;"}, // greek capital letter lambda,U+039B ISOgrk3 -->
150            {"\u039C", "&Mu;"}, // greek capital letter mu, U+039C -->
151            {"\u039D", "&Nu;"}, // greek capital letter nu, U+039D -->
152            {"\u039E", "&Xi;"}, // greek capital letter xi, U+039E ISOgrk3 -->
153            {"\u039F", "&Omicron;"}, // greek capital letter omicron, U+039F -->
154            {"\u03A0", "&Pi;"}, // greek capital letter pi, U+03A0 ISOgrk3 -->
155            {"\u03A1", "&Rho;"}, // greek capital letter rho, U+03A1 -->
156            // <!-- there is no Sigmaf, and no U+03A2 character either -->
157            {"\u03A3", "&Sigma;"}, // greek capital letter sigma,U+03A3 ISOgrk3 -->
158            {"\u03A4", "&Tau;"}, // greek capital letter tau, U+03A4 -->
159            {"\u03A5", "&Upsilon;"}, // greek capital letter upsilon,U+03A5 ISOgrk3 -->
160            {"\u03A6", "&Phi;"}, // greek capital letter phi,U+03A6 ISOgrk3 -->
161            {"\u03A7", "&Chi;"}, // greek capital letter chi, U+03A7 -->
162            {"\u03A8", "&Psi;"}, // greek capital letter psi,U+03A8 ISOgrk3 -->
163            {"\u03A9", "&Omega;"}, // greek capital letter omega,U+03A9 ISOgrk3 -->
164            {"\u03B1", "&alpha;"}, // greek small letter alpha,U+03B1 ISOgrk3 -->
165            {"\u03B2", "&beta;"}, // greek small letter beta, U+03B2 ISOgrk3 -->
166            {"\u03B3", "&gamma;"}, // greek small letter gamma,U+03B3 ISOgrk3 -->
167            {"\u03B4", "&delta;"}, // greek small letter delta,U+03B4 ISOgrk3 -->
168            {"\u03B5", "&epsilon;"}, // greek small letter epsilon,U+03B5 ISOgrk3 -->
169            {"\u03B6", "&zeta;"}, // greek small letter zeta, U+03B6 ISOgrk3 -->
170            {"\u03B7", "&eta;"}, // greek small letter eta, U+03B7 ISOgrk3 -->
171            {"\u03B8", "&theta;"}, // greek small letter theta,U+03B8 ISOgrk3 -->
172            {"\u03B9", "&iota;"}, // greek small letter iota, U+03B9 ISOgrk3 -->
173            {"\u03BA", "&kappa;"}, // greek small letter kappa,U+03BA ISOgrk3 -->
174            {"\u03BB", "&lambda;"}, // greek small letter lambda,U+03BB ISOgrk3 -->
175            {"\u03BC", "&mu;"}, // greek small letter mu, U+03BC ISOgrk3 -->
176            {"\u03BD", "&nu;"}, // greek small letter nu, U+03BD ISOgrk3 -->
177            {"\u03BE", "&xi;"}, // greek small letter xi, U+03BE ISOgrk3 -->
178            {"\u03BF", "&omicron;"}, // greek small letter omicron, U+03BF NEW -->
179            {"\u03C0", "&pi;"}, // greek small letter pi, U+03C0 ISOgrk3 -->
180            {"\u03C1", "&rho;"}, // greek small letter rho, U+03C1 ISOgrk3 -->
181            {"\u03C2", "&sigmaf;"}, // greek small letter final sigma,U+03C2 ISOgrk3 -->
182            {"\u03C3", "&sigma;"}, // greek small letter sigma,U+03C3 ISOgrk3 -->
183            {"\u03C4", "&tau;"}, // greek small letter tau, U+03C4 ISOgrk3 -->
184            {"\u03C5", "&upsilon;"}, // greek small letter upsilon,U+03C5 ISOgrk3 -->
185            {"\u03C6", "&phi;"}, // greek small letter phi, U+03C6 ISOgrk3 -->
186            {"\u03C7", "&chi;"}, // greek small letter chi, U+03C7 ISOgrk3 -->
187            {"\u03C8", "&psi;"}, // greek small letter psi, U+03C8 ISOgrk3 -->
188            {"\u03C9", "&omega;"}, // greek small letter omega,U+03C9 ISOgrk3 -->
189            {"\u03D1", "&thetasym;"}, // greek small letter theta symbol,U+03D1 NEW -->
190            {"\u03D2", "&upsih;"}, // greek upsilon with hook symbol,U+03D2 NEW -->
191            {"\u03D6", "&piv;"}, // greek pi symbol, U+03D6 ISOgrk3 -->
192            // <!-- General Punctuation -->
193            {"\u2022", "&bull;"}, // bullet = black small circle,U+2022 ISOpub -->
194            // <!-- bullet is NOT the same as bullet operator, U+2219 -->
195            {"\u2026", "&hellip;"}, // horizontal ellipsis = three dot leader,U+2026 ISOpub -->
196            {"\u2032", "&prime;"}, // prime = minutes = feet, U+2032 ISOtech -->
197            {"\u2033", "&Prime;"}, // double prime = seconds = inches,U+2033 ISOtech -->
198            {"\u203E", "&oline;"}, // overline = spacing overscore,U+203E NEW -->
199            {"\u2044", "&frasl;"}, // fraction slash, U+2044 NEW -->
200            // <!-- Letterlike Symbols -->
201            {"\u2118", "&weierp;"}, // script capital P = power set= Weierstrass p, U+2118 ISOamso -->
202            {"\u2111", "&image;"}, // blackletter capital I = imaginary part,U+2111 ISOamso -->
203            {"\u211C", "&real;"}, // blackletter capital R = real part symbol,U+211C ISOamso -->
204            {"\u2122", "&trade;"}, // trade mark sign, U+2122 ISOnum -->
205            {"\u2135", "&alefsym;"}, // alef symbol = first transfinite cardinal,U+2135 NEW -->
206            // <!-- alef symbol is NOT the same as hebrew letter alef,U+05D0 although the
207            // same glyph could be used to depict both characters -->
208            // <!-- Arrows -->
209            {"\u2190", "&larr;"}, // leftwards arrow, U+2190 ISOnum -->
210            {"\u2191", "&uarr;"}, // upwards arrow, U+2191 ISOnum-->
211            {"\u2192", "&rarr;"}, // rightwards arrow, U+2192 ISOnum -->
212            {"\u2193", "&darr;"}, // downwards arrow, U+2193 ISOnum -->
213            {"\u2194", "&harr;"}, // left right arrow, U+2194 ISOamsa -->
214            {"\u21B5", "&crarr;"}, // downwards arrow with corner leftwards= carriage return, U+21B5 NEW -->
215            {"\u21D0", "&lArr;"}, // leftwards double arrow, U+21D0 ISOtech -->
216            // <!-- ISO 10646 does not say that lArr is the same as the 'is implied by'
217            // arrow but also does not have any other character for that function.
218            // So ? lArr canbe used for 'is implied by' as ISOtech suggests -->
219            {"\u21D1", "&uArr;"}, // upwards double arrow, U+21D1 ISOamsa -->
220            {"\u21D2", "&rArr;"}, // rightwards double arrow,U+21D2 ISOtech -->
221            // <!-- ISO 10646 does not say this is the 'implies' character but does not
222            // have another character with this function so ?rArr can be used for
223            // 'implies' as ISOtech suggests -->
224            {"\u21D3", "&dArr;"}, // downwards double arrow, U+21D3 ISOamsa -->
225            {"\u21D4", "&hArr;"}, // left right double arrow,U+21D4 ISOamsa -->
226            // <!-- Mathematical Operators -->
227            {"\u2200", "&forall;"}, // for all, U+2200 ISOtech -->
228            {"\u2202", "&part;"}, // partial differential, U+2202 ISOtech -->
229            {"\u2203", "&exist;"}, // there exists, U+2203 ISOtech -->
230            {"\u2205", "&empty;"}, // empty set = null set = diameter,U+2205 ISOamso -->
231            {"\u2207", "&nabla;"}, // nabla = backward difference,U+2207 ISOtech -->
232            {"\u2208", "&isin;"}, // element of, U+2208 ISOtech -->
233            {"\u2209", "&notin;"}, // not an element of, U+2209 ISOtech -->
234            {"\u220B", "&ni;"}, // contains as member, U+220B ISOtech -->
235            // <!-- should there be a more memorable name than 'ni'? -->
236            {"\u220F", "&prod;"}, // n-ary product = product sign,U+220F ISOamsb -->
237            // <!-- prod is NOT the same character as U+03A0 'greek capital letter pi'
238            // though the same glyph might be used for both -->
239            {"\u2211", "&sum;"}, // n-ary summation, U+2211 ISOamsb -->
240            // <!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
241            // though the same glyph might be used for both -->
242            {"\u2122", "&minus;"}, // minus sign, U+2212 ISOtech -->
243            {"\u2217", "&lowast;"}, // asterisk operator, U+2217 ISOtech -->
244            {"\u221A", "&radic;"}, // square root = radical sign,U+221A ISOtech -->
245            {"\u221D", "&prop;"}, // proportional to, U+221D ISOtech -->
246            {"\u221E", "&infin;"}, // infinity, U+221E ISOtech -->
247            {"\u2220", "&ang;"}, // angle, U+2220 ISOamso -->
248            {"\u2227", "&and;"}, // logical and = wedge, U+2227 ISOtech -->
249            {"\u2228", "&or;"}, // logical or = vee, U+2228 ISOtech -->
250            {"\u2229", "&cap;"}, // intersection = cap, U+2229 ISOtech -->
251            {"\u222A", "&cup;"}, // union = cup, U+222A ISOtech -->
252            {"\u222B", "&int;"}, // integral, U+222B ISOtech -->
253            {"\u2234", "&there4;"}, // therefore, U+2234 ISOtech -->
254            {"\u223C", "&sim;"}, // tilde operator = varies with = similar to,U+223C ISOtech -->
255            // <!-- tilde operator is NOT the same character as the tilde, U+007E,although
256            // the same glyph might be used to represent both -->
257            {"\u2245", "&cong;"}, // approximately equal to, U+2245 ISOtech -->
258            {"\u2248", "&asymp;"}, // almost equal to = asymptotic to,U+2248 ISOamsr -->
259            {"\u2260", "&ne;"}, // not equal to, U+2260 ISOtech -->
260            {"\u2261", "&equiv;"}, // identical to, U+2261 ISOtech -->
261            {"\u2264", "&le;"}, // less-than or equal to, U+2264 ISOtech -->
262            {"\u2265", "&ge;"}, // greater-than or equal to,U+2265 ISOtech -->
263            {"\u2282", "&sub;"}, // subset of, U+2282 ISOtech -->
264            {"\u2283", "&sup;"}, // superset of, U+2283 ISOtech -->
265            // <!-- note that nsup, 'not a superset of, U+2283' is not covered by the
266            // Symbol font encoding and is not included. Should it be, for symmetry?
267            // It is in ISOamsn --> <!ENTITY nsub", "8836"},
268            // not a subset of, U+2284 ISOamsn -->
269            {"\u2286", "&sube;"}, // subset of or equal to, U+2286 ISOtech -->
270            {"\u2287", "&supe;"}, // superset of or equal to,U+2287 ISOtech -->
271            {"\u2295", "&oplus;"}, // circled plus = direct sum,U+2295 ISOamsb -->
272            {"\u2297", "&otimes;"}, // circled times = vector product,U+2297 ISOamsb -->
273            {"\u22A5", "&perp;"}, // up tack = orthogonal to = perpendicular,U+22A5 ISOtech -->
274            {"\u22C5", "&sdot;"}, // dot operator, U+22C5 ISOamsb -->
275            // <!-- dot operator is NOT the same character as U+00B7 middle dot -->
276            // <!-- Miscellaneous Technical -->
277            {"\u2308", "&lceil;"}, // left ceiling = apl upstile,U+2308 ISOamsc -->
278            {"\u2309", "&rceil;"}, // right ceiling, U+2309 ISOamsc -->
279            {"\u230A", "&lfloor;"}, // left floor = apl downstile,U+230A ISOamsc -->
280            {"\u230B", "&rfloor;"}, // right floor, U+230B ISOamsc -->
281            {"\u2329", "&lang;"}, // left-pointing angle bracket = bra,U+2329 ISOtech -->
282            // <!-- lang is NOT the same character as U+003C 'less than' or U+2039 'single left-pointing angle quotation
283            // mark' -->
284            {"\u232A", "&rang;"}, // right-pointing angle bracket = ket,U+232A ISOtech -->
285            // <!-- rang is NOT the same character as U+003E 'greater than' or U+203A
286            // 'single right-pointing angle quotation mark' -->
287            // <!-- Geometric Shapes -->
288            {"\u25CA", "&loz;"}, // lozenge, U+25CA ISOpub -->
289            // <!-- Miscellaneous Symbols -->
290            {"\u2660", "&spades;"}, // black spade suit, U+2660 ISOpub -->
291            // <!-- black here seems to mean filled as opposed to hollow -->
292            {"\u2663", "&clubs;"}, // black club suit = shamrock,U+2663 ISOpub -->
293            {"\u2665", "&hearts;"}, // black heart suit = valentine,U+2665 ISOpub -->
294            {"\u2666", "&diams;"}, // black diamond suit, U+2666 ISOpub -->
295    
296            // <!-- Latin Extended-A -->
297            {"\u0152", "&OElig;"}, // -- latin capital ligature OE,U+0152 ISOlat2 -->
298            {"\u0153", "&oelig;"}, // -- latin small ligature oe, U+0153 ISOlat2 -->
299            // <!-- ligature is a misnomer, this is a separate character in some languages -->
300            {"\u0160", "&Scaron;"}, // -- latin capital letter S with caron,U+0160 ISOlat2 -->
301            {"\u0161", "&scaron;"}, // -- latin small letter s with caron,U+0161 ISOlat2 -->
302            {"\u0178", "&Yuml;"}, // -- latin capital letter Y with diaeresis,U+0178 ISOlat2 -->
303            // <!-- Spacing Modifier Letters -->
304            {"\u02C6", "&circ;"}, // -- modifier letter circumflex accent,U+02C6 ISOpub -->
305            {"\u02DC", "&tilde;"}, // small tilde, U+02DC ISOdia -->
306            // <!-- General Punctuation -->
307            {"\u2002", "&ensp;"}, // en space, U+2002 ISOpub -->
308            {"\u2003", "&emsp;"}, // em space, U+2003 ISOpub -->
309            {"\u2009", "&thinsp;"}, // thin space, U+2009 ISOpub -->
310            {"\u200C", "&zwnj;"}, // zero width non-joiner,U+200C NEW RFC 2070 -->
311            {"\u200D", "&zwj;"}, // zero width joiner, U+200D NEW RFC 2070 -->
312            {"\u200E", "&lrm;"}, // left-to-right mark, U+200E NEW RFC 2070 -->
313            {"\u200F", "&rlm;"}, // right-to-left mark, U+200F NEW RFC 2070 -->
314            {"\u2013", "&ndash;"}, // en dash, U+2013 ISOpub -->
315            {"\u2014", "&mdash;"}, // em dash, U+2014 ISOpub -->
316            {"\u2018", "&lsquo;"}, // left single quotation mark,U+2018 ISOnum -->
317            {"\u2019", "&rsquo;"}, // right single quotation mark,U+2019 ISOnum -->
318            {"\u201A", "&sbquo;"}, // single low-9 quotation mark, U+201A NEW -->
319            {"\u201C", "&ldquo;"}, // left double quotation mark,U+201C ISOnum -->
320            {"\u201D", "&rdquo;"}, // right double quotation mark,U+201D ISOnum -->
321            {"\u201E", "&bdquo;"}, // double low-9 quotation mark, U+201E NEW -->
322            {"\u2020", "&dagger;"}, // dagger, U+2020 ISOpub -->
323            {"\u2021", "&Dagger;"}, // double dagger, U+2021 ISOpub -->
324            {"\u2030", "&permil;"}, // per mille sign, U+2030 ISOtech -->
325            {"\u2039", "&lsaquo;"}, // single left-pointing angle quotation mark,U+2039 ISO proposed -->
326            // <!-- lsaquo is proposed but not yet ISO standardized -->
327            {"\u203A", "&rsaquo;"}, // single right-pointing angle quotation mark,U+203A ISO proposed -->
328            // <!-- rsaquo is proposed but not yet ISO standardized -->
329            {"\u20AC", "&euro;"}, // -- euro sign, U+20AC NEW -->
330        };
331    
332        public static String[][] HTML40_EXTENDED_UNESCAPE() { return HTML40_EXTENDED_UNESCAPE.clone(); }
333        private static final String[][] HTML40_EXTENDED_UNESCAPE = invert(HTML40_EXTENDED_ESCAPE);
334    
335        public static String[][] BASIC_ESCAPE() { return BASIC_ESCAPE.clone(); }
336        private static final String[][] BASIC_ESCAPE = {
337            {"\"", "&quot;"}, // " - double-quote
338            {"&", "&amp;"},   // & - ampersand
339            {"<", "&lt;"},    // < - less-than
340            {">", "&gt;"},    // > - greater-than
341        };
342    
343        public static String[][] BASIC_UNESCAPE() { return BASIC_UNESCAPE.clone(); }
344        private static final String[][] BASIC_UNESCAPE = invert(BASIC_ESCAPE);
345    
346        public static String[][] APOS_ESCAPE() { return APOS_ESCAPE.clone(); }
347        private static final String[][] APOS_ESCAPE = {
348            {"'", "&apos;"}, // XML apostrophe
349        };
350    
351        public static String[][] APOS_UNESCAPE() { return APOS_UNESCAPE.clone(); }
352        private static final String[][] APOS_UNESCAPE = invert(APOS_ESCAPE);
353    
354        public static String[][] JAVA_CTRL_CHARS_ESCAPE() { return JAVA_CTRL_CHARS_ESCAPE.clone(); }
355        private static final String[][] JAVA_CTRL_CHARS_ESCAPE = {
356            {"\b", "\\b"},
357            {"\n", "\\n"},
358            {"\t", "\\t"},
359            {"\f", "\\f"},
360            {"\r", "\\r"}
361        };
362    
363        public static String[][] JAVA_CTRL_CHARS_UNESCAPE() { return JAVA_CTRL_CHARS_UNESCAPE.clone(); }
364        private static final String[][] JAVA_CTRL_CHARS_UNESCAPE = invert(JAVA_CTRL_CHARS_ESCAPE);
365    
366        /**
367         * Used to invert an escape array into an unescape array
368         * @param array String[][] to be inverted
369         * @return String[][] inverted array
370         */
371        public static String[][] invert(String[][] array) {
372            String[][] newarray = new String[array.length][2];
373            for(int i = 0; i<array.length; i++) {
374                newarray[i][0] = array[i][1];
375                newarray[i][1] = array[i][0];
376            }
377            return newarray;
378        }
379    
380    }