Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

117
LINES

< > BotCompany Repo | #1031866 // htmldecode_escapes

JavaX fragment (include)

1  
static S[][] htmldecode_escapes() {
2  
  ret htmldecode_ESCAPES;
3  
}
4  
5  
static final String[][] htmldecode_ESCAPES = {
6  
    {"\"",     "quot"}, // " - double-quote
7  
    {"&",      "amp"}, // & - ampersand
8  
    {"<",      "lt"}, // < - less-than
9  
    {">",      "gt"}, // > - greater-than
10  
11  
    // Mapping to escape ISO-8859-1 characters to their named HTML 3.x equivalents.
12  
    {"\u00A0", "nbsp"}, // non-breaking space
13  
    {"\u00A1", "iexcl"}, // inverted exclamation mark
14  
    {"\u00A2", "cent"}, // cent sign
15  
    {"\u00A3", "pound"}, // pound sign
16  
    {"\u00A4", "curren"}, // currency sign
17  
    {"\u00A5", "yen"}, // yen sign = yuan sign
18  
    {"\u00A6", "brvbar"}, // broken bar = broken vertical bar
19  
    {"\u00A7", "sect"}, // section sign
20  
    {"\u00A8", "uml"}, // diaeresis = spacing diaeresis
21  
    {"\u00A9", "copy"}, // copyright sign
22  
    {"\u00AA", "ordf"}, // feminine ordinal indicator
23  
    {"\u00AB", "laquo"}, // left-pointing double angle quotation mark = left pointing guillemet
24  
    {"\u00AC", "not"}, // not sign
25  
    {"\u00AD", "shy"}, // soft hyphen = discretionary hyphen
26  
    {"\u00AE", "reg"}, // registered trademark sign
27  
    {"\u00AF", "macr"}, // macron = spacing macron = overline = APL overbar
28  
    {"\u00B0", "deg"}, // degree sign
29  
    {"\u00B1", "plusmn"}, // plus-minus sign = plus-or-minus sign
30  
    {"\u00B2", "sup2"}, // superscript two = superscript digit two = squared
31  
    {"\u00B3", "sup3"}, // superscript three = superscript digit three = cubed
32  
    {"\u00B4", "acute"}, // acute accent = spacing acute
33  
    {"\u00B5", "micro"}, // micro sign
34  
    {"\u00B6", "para"}, // pilcrow sign = paragraph sign
35  
    {"\u00B7", "middot"}, // middle dot = Georgian comma = Greek middle dot
36  
    {"\u00B8", "cedil"}, // cedilla = spacing cedilla
37  
    {"\u00B9", "sup1"}, // superscript one = superscript digit one
38  
    {"\u00BA", "ordm"}, // masculine ordinal indicator
39  
    {"\u00BB", "raquo"}, // right-pointing double angle quotation mark = right pointing guillemet
40  
    {"\u00BC", "frac14"}, // vulgar fraction one quarter = fraction one quarter
41  
    {"\u00BD", "frac12"}, // vulgar fraction one half = fraction one half
42  
    {"\u00BE", "frac34"}, // vulgar fraction three quarters = fraction three quarters
43  
    {"\u00BF", "iquest"}, // inverted question mark = turned question mark
44  
    {"\u00C0", "Agrave"}, // ? - uppercase A, grave accent
45  
    {"\u00C1", "Aacute"}, // ? - uppercase A, acute accent
46  
    {"\u00C2", "Acirc"}, // ? - uppercase A, circumflex accent
47  
    {"\u00C3", "Atilde"}, // ? - uppercase A, tilde
48  
    {"\u00C4", "Auml"}, // ? - uppercase A, umlaut
49  
    {"\u00C5", "Aring"}, // ? - uppercase A, ring
50  
    {"\u00C6", "AElig"}, // ? - uppercase AE
51  
    {"\u00C7", "Ccedil"}, // ? - uppercase C, cedilla
52  
    {"\u00C8", "Egrave"}, // ? - uppercase E, grave accent
53  
    {"\u00C9", "Eacute"}, // ? - uppercase E, acute accent
54  
    {"\u00CA", "Ecirc"}, // ? - uppercase E, circumflex accent
55  
    {"\u00CB", "Euml"}, // ? - uppercase E, umlaut
56  
    {"\u00CC", "Igrave"}, // ? - uppercase I, grave accent
57  
    {"\u00CD", "Iacute"}, // ? - uppercase I, acute accent
58  
    {"\u00CE", "Icirc"}, // ? - uppercase I, circumflex accent
59  
    {"\u00CF", "Iuml"}, // ? - uppercase I, umlaut
60  
    {"\u00D0", "ETH"}, // ? - uppercase Eth, Icelandic
61  
    {"\u00D1", "Ntilde"}, // ? - uppercase N, tilde
62  
    {"\u00D2", "Ograve"}, // ? - uppercase O, grave accent
63  
    {"\u00D3", "Oacute"}, // ? - uppercase O, acute accent
64  
    {"\u00D4", "Ocirc"}, // ? - uppercase O, circumflex accent
65  
    {"\u00D5", "Otilde"}, // ? - uppercase O, tilde
66  
    {"\u00D6", "Ouml"}, // ? - uppercase O, umlaut
67  
    {"\u00D7", "times"}, // multiplication sign
68  
    {"\u00D8", "Oslash"}, // ? - uppercase O, slash
69  
    {"\u00D9", "Ugrave"}, // ? - uppercase U, grave accent
70  
    {"\u00DA", "Uacute"}, // ? - uppercase U, acute accent
71  
    {"\u00DB", "Ucirc"}, // ? - uppercase U, circumflex accent
72  
    {"\u00DC", "Uuml"}, // ? - uppercase U, umlaut
73  
    {"\u00DD", "Yacute"}, // ? - uppercase Y, acute accent
74  
    {"\u00DE", "THORN"}, // ? - uppercase THORN, Icelandic
75  
    {"\u00DF", "szlig"}, // ? - lowercase sharps, German
76  
    {"\u00E0", "agrave"}, // ? - lowercase a, grave accent
77  
    {"\u00E1", "aacute"}, // ? - lowercase a, acute accent
78  
    {"\u00E2", "acirc"}, // ? - lowercase a, circumflex accent
79  
    {"\u00E3", "atilde"}, // ? - lowercase a, tilde
80  
    {"\u00E4", "auml"}, // ? - lowercase a, umlaut
81  
    {"\u00E5", "aring"}, // ? - lowercase a, ring
82  
    {"\u00E6", "aelig"}, // ? - lowercase ae
83  
    {"\u00E7", "ccedil"}, // ? - lowercase c, cedilla
84  
    {"\u00E8", "egrave"}, // ? - lowercase e, grave accent
85  
    {"\u00E9", "eacute"}, // ? - lowercase e, acute accent
86  
    {"\u00EA", "ecirc"}, // ? - lowercase e, circumflex accent
87  
    {"\u00EB", "euml"}, // ? - lowercase e, umlaut
88  
    {"\u00EC", "igrave"}, // ? - lowercase i, grave accent
89  
    {"\u00ED", "iacute"}, // ? - lowercase i, acute accent
90  
    {"\u00EE", "icirc"}, // ? - lowercase i, circumflex accent
91  
    {"\u00EF", "iuml"}, // ? - lowercase i, umlaut
92  
    {"\u00F0", "eth"}, // ? - lowercase eth, Icelandic
93  
    {"\u00F1", "ntilde"}, // ? - lowercase n, tilde
94  
    {"\u00F2", "ograve"}, // ? - lowercase o, grave accent
95  
    {"\u00F3", "oacute"}, // ? - lowercase o, acute accent
96  
    {"\u00F4", "ocirc"}, // ? - lowercase o, circumflex accent
97  
    {"\u00F5", "otilde"}, // ? - lowercase o, tilde
98  
    {"\u00F6", "ouml"}, // ? - lowercase o, umlaut
99  
    {"\u00F7", "divide"}, // division sign
100  
    {"\u00F8", "oslash"}, // ? - lowercase o, slash
101  
    {"\u00F9", "ugrave"}, // ? - lowercase u, grave accent
102  
    {"\u00FA", "uacute"}, // ? - lowercase u, acute accent
103  
    {"\u00FB", "ucirc"}, // ? - lowercase u, circumflex accent
104  
    {"\u00FC", "uuml"}, // ? - lowercase u, umlaut
105  
    {"\u00FD", "yacute"}, // ? - lowercase y, acute accent
106  
    {"\u00FE", "thorn"}, // ? - lowercase thorn, Icelandic
107  
    {"\u00FF", "yuml"}, // ? - lowercase y, umlaut
108  
    {"\u2013", "ndash"},
109  
    {"\u2018", "lsquo"},
110  
    {"\u2019", "rsquo"},
111  
    {"\u201D", "rdquo"},
112  
    {"\u201C", "ldquo"},
113  
    {"\u2014", "mdash"},
114  
    
115  
    {"'", "apos"}, // the controversial (but who cares!) &apos;
116  
      // stackoverflow.com/questions/2083754/why-shouldnt-apos-be-used-to-escape-single-quotes
117  
  };

Author comment

Began life as a copy of #1000793

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031866
Snippet name: htmldecode_escapes
Eternal ID of this version: #1031866/1
Text MD5: 5ffce265abecae978e06f151c2156f71
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-21 15:46:05
Source code size: 6295 bytes / 117 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 185
Referenced in: [show references]