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@11174 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser
2016-02-14 19:49:08 +00:00
parent f6e6c20843
commit 0e47a4a8a9
+115 -111
View File
@@ -3352,14 +3352,18 @@ Fl_Help_View::value(const char *val) // I - Text to view
} }
#ifdef ENC /* Returns the Unicode Code Point associated with a quoted character
# undef ENC (aka "HTML Entity").
#endif
// part b in the table seems to be mac_roman - beku
# define ENC(a, b) a
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 static int // O - Code or -1 on error
quote_char(const char *p) { // I - Quoted string quote_char(const char *p) { // I - Quoted string
int i; // Looping var int i; // Looping var
@@ -3369,111 +3373,111 @@ quote_char(const char *p) { // I - Quoted string
int code; int code;
} *nameptr, // Pointer into name array } *nameptr, // Pointer into name array
names[] = { // Quoting names names[] = { // Quoting names
{ "Aacute;", 7, ENC(193,231) }, { "Aacute;", 7, 193 },
{ "aacute;", 7, ENC(225,135) }, { "aacute;", 7, 225 },
{ "Acirc;", 6, ENC(194,229) }, { "Acirc;", 6, 194 },
{ "acirc;", 6, ENC(226,137) }, { "acirc;", 6, 226 },
{ "acute;", 6, ENC(180,171) }, { "acute;", 6, 180 },
{ "AElig;", 6, ENC(198,174) }, { "AElig;", 6, 198 },
{ "aelig;", 6, ENC(230,190) }, { "aelig;", 6, 230 },
{ "Agrave;", 7, ENC(192,203) }, { "Agrave;", 7, 192 },
{ "agrave;", 7, ENC(224,136) }, { "agrave;", 7, 224 },
{ "amp;", 4, ENC('&','&') }, { "amp;", 4, '&' },
{ "Aring;", 6, ENC(197,129) }, { "Aring;", 6, 197 },
{ "aring;", 6, ENC(229,140) }, { "aring;", 6, 229 },
{ "Atilde;", 7, ENC(195,204) }, { "Atilde;", 7, 195 },
{ "atilde;", 7, ENC(227,139) }, { "atilde;", 7, 227 },
{ "Auml;", 5, ENC(196,128) }, { "Auml;", 5, 196 },
{ "auml;", 5, ENC(228,138) }, { "auml;", 5, 228 },
{ "brvbar;", 7, ENC(166, -1) }, { "brvbar;", 7, 166 },
{ "bull;", 5, ENC(149,165) }, { "bull;", 5, 0x2022 },
{ "Ccedil;", 7, ENC(199,199) }, { "Ccedil;", 7, 199 },
{ "ccedil;", 7, ENC(231,141) }, { "ccedil;", 7, 231 },
{ "cedil;", 6, ENC(184,252) }, { "cedil;", 6, 184 },
{ "cent;", 5, ENC(162,162) }, { "cent;", 5, 162 },
{ "copy;", 5, ENC(169,169) }, { "copy;", 5, 169 },
{ "curren;", 7, ENC(164, -1) }, { "curren;", 7, 164 },
{ "deg;", 4, ENC(176,161) }, { "deg;", 4, 176 },
{ "divide;", 7, ENC(247,214) }, { "divide;", 7, 247 },
{ "Eacute;", 7, ENC(201,131) }, { "Eacute;", 7, 201 },
{ "eacute;", 7, ENC(233,142) }, { "eacute;", 7, 233 },
{ "Ecirc;", 6, ENC(202,230) }, { "Ecirc;", 6, 202 },
{ "ecirc;", 6, ENC(234,144) }, { "ecirc;", 6, 234 },
{ "Egrave;", 7, ENC(200,233) }, { "Egrave;", 7, 200 },
{ "egrave;", 7, ENC(232,143) }, { "egrave;", 7, 232 },
{ "ETH;", 4, ENC(208, -1) }, { "ETH;", 4, 208 },
{ "eth;", 4, ENC(240, -1) }, { "eth;", 4, 240 },
{ "Euml;", 5, ENC(203,232) }, { "Euml;", 5, 203 },
{ "euml;", 5, ENC(235,145) }, { "euml;", 5, 235 },
{ "euro;", 5, ENC(128,219) }, { "euro;", 5, 0x20ac },
{ "frac12;", 7, ENC(189, -1) }, { "frac12;", 7, 189 },
{ "frac14;", 7, ENC(188, -1) }, { "frac14;", 7, 188 },
{ "frac34;", 7, ENC(190, -1) }, { "frac34;", 7, 190 },
{ "gt;", 3, ENC('>','>') }, { "gt;", 3, '>' },
{ "Iacute;", 7, ENC(205,234) }, { "Iacute;", 7, 205 },
{ "iacute;", 7, ENC(237,146) }, { "iacute;", 7, 237 },
{ "Icirc;", 6, ENC(206,235) }, { "Icirc;", 6, 206 },
{ "icirc;", 6, ENC(238,148) }, { "icirc;", 6, 238 },
{ "iexcl;", 6, ENC(161,193) }, { "iexcl;", 6, 161 },
{ "Igrave;", 7, ENC(204,237) }, { "Igrave;", 7, 204 },
{ "igrave;", 7, ENC(236,147) }, { "igrave;", 7, 236 },
{ "iquest;", 7, ENC(191,192) }, { "iquest;", 7, 191 },
{ "Iuml;", 5, ENC(207,236) }, { "Iuml;", 5, 207 },
{ "iuml;", 5, ENC(239,149) }, { "iuml;", 5, 239 },
{ "laquo;", 6, ENC(171,199) }, { "laquo;", 6, 171 },
{ "lt;", 3, ENC('<','<') }, { "lt;", 3, '<' },
{ "macr;", 5, ENC(175,248) }, { "macr;", 5, 175 },
{ "micro;", 6, ENC(181,181) }, { "micro;", 6, 181 },
{ "middot;", 7, ENC(183,225) }, { "middot;", 7, 183 },
{ "nbsp;", 5, ENC(' ',' ') }, { "nbsp;", 5, ' ' },
{ "not;", 4, ENC(172,194) }, { "not;", 4, 172 },
{ "Ntilde;", 7, ENC(209,132) }, { "Ntilde;", 7, 209 },
{ "ntilde;", 7, ENC(241,150) }, { "ntilde;", 7, 241 },
{ "Oacute;", 7, ENC(211,238) }, { "Oacute;", 7, 211 },
{ "oacute;", 7, ENC(243,151) }, { "oacute;", 7, 243 },
{ "Ocirc;", 6, ENC(212,239) }, { "Ocirc;", 6, 212 },
{ "ocirc;", 6, ENC(244,153) }, { "ocirc;", 6, 244 },
{ "Ograve;", 7, ENC(210,241) }, { "Ograve;", 7, 210 },
{ "ograve;", 7, ENC(242,152) }, { "ograve;", 7, 242 },
{ "ordf;", 5, ENC(170,187) }, { "ordf;", 5, 170 },
{ "ordm;", 5, ENC(186,188) }, { "ordm;", 5, 186 },
{ "Oslash;", 7, ENC(216,175) }, { "Oslash;", 7, 216 },
{ "oslash;", 7, ENC(248,191) }, { "oslash;", 7, 248 },
{ "Otilde;", 7, ENC(213,205) }, { "Otilde;", 7, 213 },
{ "otilde;", 7, ENC(245,155) }, { "otilde;", 7, 245 },
{ "Ouml;", 5, ENC(214,133) }, { "Ouml;", 5, 214 },
{ "ouml;", 5, ENC(246,154) }, { "ouml;", 5, 246 },
{ "para;", 5, ENC(182,166) }, { "para;", 5, 182 },
{ "premil;", 7, ENC(137,228) }, { "permil;", 7, 0x2030 },
{ "plusmn;", 7, ENC(177,177) }, { "plusmn;", 7, 177 },
{ "pound;", 6, ENC(163,163) }, { "pound;", 6, 163 },
{ "quot;", 5, ENC('\"','\"') }, { "quot;", 5, '\"' },
{ "raquo;", 6, ENC(187,200) }, { "raquo;", 6, 187 },
{ "reg;", 4, ENC(174,168) }, { "reg;", 4, 174 },
{ "sect;", 5, ENC(167,164) }, { "sect;", 5, 167 },
{ "shy;", 4, ENC(173,'-') }, { "shy;", 4, 173 },
{ "sup1;", 5, ENC(185, -1) }, { "sup1;", 5, 185 },
{ "sup2;", 5, ENC(178, -1) }, { "sup2;", 5, 178 },
{ "sup3;", 5, ENC(179, -1) }, { "sup3;", 5, 179 },
{ "szlig;", 6, ENC(223,167) }, { "szlig;", 6, 223 },
{ "THORN;", 6, ENC(222, -1) }, { "THORN;", 6, 222 },
{ "thorn;", 6, ENC(254, -1) }, { "thorn;", 6, 254 },
{ "times;", 6, ENC(215,'x') }, { "times;", 6, 215 },
{ "trade;", 6, ENC(153,170) }, { "trade;", 6, 0x2122 },
{ "Uacute;", 7, ENC(218,242) }, { "Uacute;", 7, 218 },
{ "uacute;", 7, ENC(250,156) }, { "uacute;", 7, 250 },
{ "Ucirc;", 6, ENC(219,243) }, { "Ucirc;", 6, 219 },
{ "ucirc;", 6, ENC(251,158) }, { "ucirc;", 6, 251 },
{ "Ugrave;", 7, ENC(217,244) }, { "Ugrave;", 7, 217 },
{ "ugrave;", 7, ENC(249,157) }, { "ugrave;", 7, 249 },
{ "uml;", 4, ENC(168,172) }, { "uml;", 4, 168 },
{ "Uuml;", 5, ENC(220,134) }, { "Uuml;", 5, 220 },
{ "uuml;", 5, ENC(252,159) }, { "uuml;", 5, 252 },
{ "Yacute;", 7, ENC(221, -1) }, { "Yacute;", 7, 221 },
{ "yacute;", 7, ENC(253, -1) }, { "yacute;", 7, 253 },
{ "yen;", 4, ENC(165,180) }, { "yen;", 4, 165 },
{ "Yuml;", 5, ENC(159,217) }, { "Yuml;", 5, 0x0178 },
{ "yuml;", 5, ENC(255,216) } { "yuml;", 5, 255 }
}; };
if (!strchr(p, ';')) return -1; if (!strchr(p, ';')) return -1;