summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-02-14 19:50:57 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-02-14 19:50:57 +0000
commit0c4804270bbf3c37b66b6695e07a1985ac31a384 (patch)
treecd12a75d5e4e0ff1af89c12d3ae4aa140e189e1c
parent17fc58f6adaf3a32a21944e2b1f6053c54375fd6 (diff)
Fix HTML entities in Fl_Help_View.
Removed obsolete ENC() macro, fixed some encodings that were still Windows CP-1252: converted to correct Unicode values. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11175 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Help_View.cxx226
1 files changed, 115 insertions, 111 deletions
diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx
index d0c09f1a7..9800cb22c 100644
--- a/src/Fl_Help_View.cxx
+++ b/src/Fl_Help_View.cxx
@@ -3352,14 +3352,18 @@ Fl_Help_View::value(const char *val) // I - Text to view
}
-#ifdef ENC
-# undef ENC
-#endif
-// part b in the table seems to be mac_roman - beku
-# define ENC(a, b) a
+/* Returns the Unicode Code Point associated with a quoted character
+ (aka "HTML Entity").
+ All printable ASCII (32-126) and ISO-8859-1 (160-255) characters
+ are encoded with the same value in Unicode. Special characters
+ outside the range [0-255] are encoded with their Unicode value
+ as hexadecimal constants. Example:
+ - Euro sign: (Unicode) U+20ac = (hex) 0x20ac
-/** Returns the character code associated with a quoted char. */
+ Note: Converted to correct Unicode values and tested (compared with
+ the display of Firefox). AlbrechtS, 14 Feb. 2016.
+*/
static int // O - Code or -1 on error
quote_char(const char *p) { // I - Quoted string
int i; // Looping var
@@ -3369,111 +3373,111 @@ quote_char(const char *p) { // I - Quoted string
int code;
} *nameptr, // Pointer into name array
names[] = { // Quoting names
- { "Aacute;", 7, ENC(193,231) },
- { "aacute;", 7, ENC(225,135) },
- { "Acirc;", 6, ENC(194,229) },
- { "acirc;", 6, ENC(226,137) },
- { "acute;", 6, ENC(180,171) },
- { "AElig;", 6, ENC(198,174) },
- { "aelig;", 6, ENC(230,190) },
- { "Agrave;", 7, ENC(192,203) },
- { "agrave;", 7, ENC(224,136) },
- { "amp;", 4, ENC('&','&') },
- { "Aring;", 6, ENC(197,129) },
- { "aring;", 6, ENC(229,140) },
- { "Atilde;", 7, ENC(195,204) },
- { "atilde;", 7, ENC(227,139) },
- { "Auml;", 5, ENC(196,128) },
- { "auml;", 5, ENC(228,138) },
- { "brvbar;", 7, ENC(166, -1) },
- { "bull;", 5, ENC(149,165) },
- { "Ccedil;", 7, ENC(199,199) },
- { "ccedil;", 7, ENC(231,141) },
- { "cedil;", 6, ENC(184,252) },
- { "cent;", 5, ENC(162,162) },
- { "copy;", 5, ENC(169,169) },
- { "curren;", 7, ENC(164, -1) },
- { "deg;", 4, ENC(176,161) },
- { "divide;", 7, ENC(247,214) },
- { "Eacute;", 7, ENC(201,131) },
- { "eacute;", 7, ENC(233,142) },
- { "Ecirc;", 6, ENC(202,230) },
- { "ecirc;", 6, ENC(234,144) },
- { "Egrave;", 7, ENC(200,233) },
- { "egrave;", 7, ENC(232,143) },
- { "ETH;", 4, ENC(208, -1) },
- { "eth;", 4, ENC(240, -1) },
- { "Euml;", 5, ENC(203,232) },
- { "euml;", 5, ENC(235,145) },
- { "euro;", 5, ENC(128,219) },
- { "frac12;", 7, ENC(189, -1) },
- { "frac14;", 7, ENC(188, -1) },
- { "frac34;", 7, ENC(190, -1) },
- { "gt;", 3, ENC('>','>') },
- { "Iacute;", 7, ENC(205,234) },
- { "iacute;", 7, ENC(237,146) },
- { "Icirc;", 6, ENC(206,235) },
- { "icirc;", 6, ENC(238,148) },
- { "iexcl;", 6, ENC(161,193) },
- { "Igrave;", 7, ENC(204,237) },
- { "igrave;", 7, ENC(236,147) },
- { "iquest;", 7, ENC(191,192) },
- { "Iuml;", 5, ENC(207,236) },
- { "iuml;", 5, ENC(239,149) },
- { "laquo;", 6, ENC(171,199) },
- { "lt;", 3, ENC('<','<') },
- { "macr;", 5, ENC(175,248) },
- { "micro;", 6, ENC(181,181) },
- { "middot;", 7, ENC(183,225) },
- { "nbsp;", 5, ENC(' ',' ') },
- { "not;", 4, ENC(172,194) },
- { "Ntilde;", 7, ENC(209,132) },
- { "ntilde;", 7, ENC(241,150) },
- { "Oacute;", 7, ENC(211,238) },
- { "oacute;", 7, ENC(243,151) },
- { "Ocirc;", 6, ENC(212,239) },
- { "ocirc;", 6, ENC(244,153) },
- { "Ograve;", 7, ENC(210,241) },
- { "ograve;", 7, ENC(242,152) },
- { "ordf;", 5, ENC(170,187) },
- { "ordm;", 5, ENC(186,188) },
- { "Oslash;", 7, ENC(216,175) },
- { "oslash;", 7, ENC(248,191) },
- { "Otilde;", 7, ENC(213,205) },
- { "otilde;", 7, ENC(245,155) },
- { "Ouml;", 5, ENC(214,133) },
- { "ouml;", 5, ENC(246,154) },
- { "para;", 5, ENC(182,166) },
- { "premil;", 7, ENC(137,228) },
- { "plusmn;", 7, ENC(177,177) },
- { "pound;", 6, ENC(163,163) },
- { "quot;", 5, ENC('\"','\"') },
- { "raquo;", 6, ENC(187,200) },
- { "reg;", 4, ENC(174,168) },
- { "sect;", 5, ENC(167,164) },
- { "shy;", 4, ENC(173,'-') },
- { "sup1;", 5, ENC(185, -1) },
- { "sup2;", 5, ENC(178, -1) },
- { "sup3;", 5, ENC(179, -1) },
- { "szlig;", 6, ENC(223,167) },
- { "THORN;", 6, ENC(222, -1) },
- { "thorn;", 6, ENC(254, -1) },
- { "times;", 6, ENC(215,'x') },
- { "trade;", 6, ENC(153,170) },
- { "Uacute;", 7, ENC(218,242) },
- { "uacute;", 7, ENC(250,156) },
- { "Ucirc;", 6, ENC(219,243) },
- { "ucirc;", 6, ENC(251,158) },
- { "Ugrave;", 7, ENC(217,244) },
- { "ugrave;", 7, ENC(249,157) },
- { "uml;", 4, ENC(168,172) },
- { "Uuml;", 5, ENC(220,134) },
- { "uuml;", 5, ENC(252,159) },
- { "Yacute;", 7, ENC(221, -1) },
- { "yacute;", 7, ENC(253, -1) },
- { "yen;", 4, ENC(165,180) },
- { "Yuml;", 5, ENC(159,217) },
- { "yuml;", 5, ENC(255,216) }
+ { "Aacute;", 7, 193 },
+ { "aacute;", 7, 225 },
+ { "Acirc;", 6, 194 },
+ { "acirc;", 6, 226 },
+ { "acute;", 6, 180 },
+ { "AElig;", 6, 198 },
+ { "aelig;", 6, 230 },
+ { "Agrave;", 7, 192 },
+ { "agrave;", 7, 224 },
+ { "amp;", 4, '&' },
+ { "Aring;", 6, 197 },
+ { "aring;", 6, 229 },
+ { "Atilde;", 7, 195 },
+ { "atilde;", 7, 227 },
+ { "Auml;", 5, 196 },
+ { "auml;", 5, 228 },
+ { "brvbar;", 7, 166 },
+ { "bull;", 5, 0x2022 },
+ { "Ccedil;", 7, 199 },
+ { "ccedil;", 7, 231 },
+ { "cedil;", 6, 184 },
+ { "cent;", 5, 162 },
+ { "copy;", 5, 169 },
+ { "curren;", 7, 164 },
+ { "deg;", 4, 176 },
+ { "divide;", 7, 247 },
+ { "Eacute;", 7, 201 },
+ { "eacute;", 7, 233 },
+ { "Ecirc;", 6, 202 },
+ { "ecirc;", 6, 234 },
+ { "Egrave;", 7, 200 },
+ { "egrave;", 7, 232 },
+ { "ETH;", 4, 208 },
+ { "eth;", 4, 240 },
+ { "Euml;", 5, 203 },
+ { "euml;", 5, 235 },
+ { "euro;", 5, 0x20ac },
+ { "frac12;", 7, 189 },
+ { "frac14;", 7, 188 },
+ { "frac34;", 7, 190 },
+ { "gt;", 3, '>' },
+ { "Iacute;", 7, 205 },
+ { "iacute;", 7, 237 },
+ { "Icirc;", 6, 206 },
+ { "icirc;", 6, 238 },
+ { "iexcl;", 6, 161 },
+ { "Igrave;", 7, 204 },
+ { "igrave;", 7, 236 },
+ { "iquest;", 7, 191 },
+ { "Iuml;", 5, 207 },
+ { "iuml;", 5, 239 },
+ { "laquo;", 6, 171 },
+ { "lt;", 3, '<' },
+ { "macr;", 5, 175 },
+ { "micro;", 6, 181 },
+ { "middot;", 7, 183 },
+ { "nbsp;", 5, ' ' },
+ { "not;", 4, 172 },
+ { "Ntilde;", 7, 209 },
+ { "ntilde;", 7, 241 },
+ { "Oacute;", 7, 211 },
+ { "oacute;", 7, 243 },
+ { "Ocirc;", 6, 212 },
+ { "ocirc;", 6, 244 },
+ { "Ograve;", 7, 210 },
+ { "ograve;", 7, 242 },
+ { "ordf;", 5, 170 },
+ { "ordm;", 5, 186 },
+ { "Oslash;", 7, 216 },
+ { "oslash;", 7, 248 },
+ { "Otilde;", 7, 213 },
+ { "otilde;", 7, 245 },
+ { "Ouml;", 5, 214 },
+ { "ouml;", 5, 246 },
+ { "para;", 5, 182 },
+ { "permil;", 7, 0x2030 },
+ { "plusmn;", 7, 177 },
+ { "pound;", 6, 163 },
+ { "quot;", 5, '\"' },
+ { "raquo;", 6, 187 },
+ { "reg;", 4, 174 },
+ { "sect;", 5, 167 },
+ { "shy;", 4, 173 },
+ { "sup1;", 5, 185 },
+ { "sup2;", 5, 178 },
+ { "sup3;", 5, 179 },
+ { "szlig;", 6, 223 },
+ { "THORN;", 6, 222 },
+ { "thorn;", 6, 254 },
+ { "times;", 6, 215 },
+ { "trade;", 6, 0x2122 },
+ { "Uacute;", 7, 218 },
+ { "uacute;", 7, 250 },
+ { "Ucirc;", 6, 219 },
+ { "ucirc;", 6, 251 },
+ { "Ugrave;", 7, 217 },
+ { "ugrave;", 7, 249 },
+ { "uml;", 4, 168 },
+ { "Uuml;", 5, 220 },
+ { "uuml;", 5, 252 },
+ { "Yacute;", 7, 221 },
+ { "yacute;", 7, 253 },
+ { "yen;", 4, 165 },
+ { "Yuml;", 5, 0x0178 },
+ { "yuml;", 5, 255 }
};
if (!strchr(p, ';')) return -1;