Added Latin1 CER support, bug 42221, r=rjc.

This commit is contained in:
nhotta%netscape.com 2007-09-06 21:57:39 +00:00
Родитель cb0b4fc7df
Коммит 058e8e37c1
1 изменённых файлов: 99 добавлений и 5 удалений

Просмотреть файл

@ -5539,11 +5539,105 @@ InternetSearchDataSource::ConvertEntities(nsString &nameStr, PRBool removeHTMLFl
PRUnichar entityChar = 0;
if (entityStr.EqualsIgnoreCase(""")) entityChar = PRUnichar('\"');
if (entityStr.EqualsIgnoreCase("&")) entityChar = PRUnichar('&');
if (entityStr.EqualsIgnoreCase(" ")) entityChar = PRUnichar(' ');
if (entityStr.EqualsIgnoreCase("&lt;")) entityChar = PRUnichar('<');
if (entityStr.EqualsIgnoreCase("&gt;")) entityChar = PRUnichar('>');
if (entityStr.EqualsIgnoreCase("&pound;")) entityChar = PRUnichar(163);
else if (entityStr.EqualsIgnoreCase("&amp;")) entityChar = PRUnichar('&');
else if (entityStr.EqualsIgnoreCase("&nbsp;")) entityChar = PRUnichar(' ');
else if (entityStr.EqualsIgnoreCase("&lt;")) entityChar = PRUnichar('<');
else if (entityStr.EqualsIgnoreCase("&gt;")) entityChar = PRUnichar('>');
else if (entityStr.EqualsIgnoreCase("&iexcl;")) entityChar = PRUnichar(161);
else if (entityStr.EqualsIgnoreCase("&cent;")) entityChar = PRUnichar(162);
else if (entityStr.EqualsIgnoreCase("&pound;")) entityChar = PRUnichar(163);
else if (entityStr.EqualsIgnoreCase("&curren;")) entityChar = PRUnichar(164);
else if (entityStr.EqualsIgnoreCase("&yen;")) entityChar = PRUnichar(165);
else if (entityStr.EqualsIgnoreCase("&brvbar;")) entityChar = PRUnichar(166);
else if (entityStr.EqualsIgnoreCase("&sect;")) entityChar = PRUnichar(167);
else if (entityStr.EqualsIgnoreCase("&uml;")) entityChar = PRUnichar(168);
else if (entityStr.EqualsIgnoreCase("&copy;")) entityChar = PRUnichar(169);
else if (entityStr.EqualsIgnoreCase("&ordf;")) entityChar = PRUnichar(170);
else if (entityStr.EqualsIgnoreCase("&laquo;")) entityChar = PRUnichar(171);
else if (entityStr.EqualsIgnoreCase("&not;")) entityChar = PRUnichar(172);
else if (entityStr.EqualsIgnoreCase("&shy;")) entityChar = PRUnichar(173);
else if (entityStr.EqualsIgnoreCase("&reg;")) entityChar = PRUnichar(174);
else if (entityStr.EqualsIgnoreCase("&macr;")) entityChar = PRUnichar(175);
else if (entityStr.EqualsIgnoreCase("&deg;")) entityChar = PRUnichar(176);
else if (entityStr.EqualsIgnoreCase("&plusmn;")) entityChar = PRUnichar(177);
else if (entityStr.EqualsIgnoreCase("&sup2;")) entityChar = PRUnichar(178);
else if (entityStr.EqualsIgnoreCase("&sup3;")) entityChar = PRUnichar(179);
else if (entityStr.EqualsIgnoreCase("&acute;")) entityChar = PRUnichar(180);
else if (entityStr.EqualsIgnoreCase("&micro;")) entityChar = PRUnichar(181);
else if (entityStr.EqualsIgnoreCase("&para;")) entityChar = PRUnichar(182);
else if (entityStr.EqualsIgnoreCase("&middot;")) entityChar = PRUnichar(183);
else if (entityStr.EqualsIgnoreCase("&cedil;")) entityChar = PRUnichar(184);
else if (entityStr.EqualsIgnoreCase("&sup1;")) entityChar = PRUnichar(185);
else if (entityStr.EqualsIgnoreCase("&ordm;")) entityChar = PRUnichar(186);
else if (entityStr.EqualsIgnoreCase("&raquo;")) entityChar = PRUnichar(187);
else if (entityStr.EqualsIgnoreCase("&frac14;")) entityChar = PRUnichar(188);
else if (entityStr.EqualsIgnoreCase("&frac12;")) entityChar = PRUnichar(189);
else if (entityStr.EqualsIgnoreCase("&frac34;")) entityChar = PRUnichar(190);
else if (entityStr.EqualsIgnoreCase("&iquest;")) entityChar = PRUnichar(191);
else if (entityStr.EqualsIgnoreCase("&Agrave;")) entityChar = PRUnichar(192);
else if (entityStr.EqualsIgnoreCase("&Aacute;")) entityChar = PRUnichar(193);
else if (entityStr.EqualsIgnoreCase("&Acirc;")) entityChar = PRUnichar(194);
else if (entityStr.EqualsIgnoreCase("&Atilde;")) entityChar = PRUnichar(195);
else if (entityStr.EqualsIgnoreCase("&Auml;")) entityChar = PRUnichar(196);
else if (entityStr.EqualsIgnoreCase("&Aring;")) entityChar = PRUnichar(197);
else if (entityStr.EqualsIgnoreCase("&AElig;")) entityChar = PRUnichar(198);
else if (entityStr.EqualsIgnoreCase("&Ccedil;")) entityChar = PRUnichar(199);
else if (entityStr.EqualsIgnoreCase("&Egrave;")) entityChar = PRUnichar(200);
else if (entityStr.EqualsIgnoreCase("&Eacute;")) entityChar = PRUnichar(201);
else if (entityStr.EqualsIgnoreCase("&Ecirc;")) entityChar = PRUnichar(202);
else if (entityStr.EqualsIgnoreCase("&Euml;")) entityChar = PRUnichar(203);
else if (entityStr.EqualsIgnoreCase("&Igrave;")) entityChar = PRUnichar(204);
else if (entityStr.EqualsIgnoreCase("&Iacute;")) entityChar = PRUnichar(205);
else if (entityStr.EqualsIgnoreCase("&Icirc;")) entityChar = PRUnichar(206);
else if (entityStr.EqualsIgnoreCase("&Iuml;")) entityChar = PRUnichar(207);
else if (entityStr.EqualsIgnoreCase("&ETH;")) entityChar = PRUnichar(208);
else if (entityStr.EqualsIgnoreCase("&Ntilde;")) entityChar = PRUnichar(209);
else if (entityStr.EqualsIgnoreCase("&Ograve;")) entityChar = PRUnichar(210);
else if (entityStr.EqualsIgnoreCase("&Oacute;")) entityChar = PRUnichar(211);
else if (entityStr.EqualsIgnoreCase("&Ocirc;")) entityChar = PRUnichar(212);
else if (entityStr.EqualsIgnoreCase("&Otilde;")) entityChar = PRUnichar(213);
else if (entityStr.EqualsIgnoreCase("&Ouml;")) entityChar = PRUnichar(214);
else if (entityStr.EqualsIgnoreCase("&times;")) entityChar = PRUnichar(215);
else if (entityStr.EqualsIgnoreCase("&Oslash;")) entityChar = PRUnichar(216);
else if (entityStr.EqualsIgnoreCase("&Ugrave;")) entityChar = PRUnichar(217);
else if (entityStr.EqualsIgnoreCase("&Uacute;")) entityChar = PRUnichar(218);
else if (entityStr.EqualsIgnoreCase("&Ucirc;")) entityChar = PRUnichar(219);
else if (entityStr.EqualsIgnoreCase("&Uuml;")) entityChar = PRUnichar(220);
else if (entityStr.EqualsIgnoreCase("&Yacute;")) entityChar = PRUnichar(221);
else if (entityStr.EqualsIgnoreCase("&THORN;")) entityChar = PRUnichar(222);
else if (entityStr.EqualsIgnoreCase("&szlig;")) entityChar = PRUnichar(223);
else if (entityStr.EqualsIgnoreCase("&agrave;")) entityChar = PRUnichar(224);
else if (entityStr.EqualsIgnoreCase("&aacute;")) entityChar = PRUnichar(225);
else if (entityStr.EqualsIgnoreCase("&acirc;")) entityChar = PRUnichar(226);
else if (entityStr.EqualsIgnoreCase("&atilde;")) entityChar = PRUnichar(227);
else if (entityStr.EqualsIgnoreCase("&auml;")) entityChar = PRUnichar(228);
else if (entityStr.EqualsIgnoreCase("&aring;")) entityChar = PRUnichar(229);
else if (entityStr.EqualsIgnoreCase("&aelig;")) entityChar = PRUnichar(230);
else if (entityStr.EqualsIgnoreCase("&ccedil;")) entityChar = PRUnichar(231);
else if (entityStr.EqualsIgnoreCase("&egrave;")) entityChar = PRUnichar(232);
else if (entityStr.EqualsIgnoreCase("&eacute;")) entityChar = PRUnichar(233);
else if (entityStr.EqualsIgnoreCase("&ecirc;")) entityChar = PRUnichar(234);
else if (entityStr.EqualsIgnoreCase("&euml;")) entityChar = PRUnichar(235);
else if (entityStr.EqualsIgnoreCase("&igrave;")) entityChar = PRUnichar(236);
else if (entityStr.EqualsIgnoreCase("&iacute;")) entityChar = PRUnichar(237);
else if (entityStr.EqualsIgnoreCase("&icirc;")) entityChar = PRUnichar(238);
else if (entityStr.EqualsIgnoreCase("&iuml;")) entityChar = PRUnichar(239);
else if (entityStr.EqualsIgnoreCase("&eth;")) entityChar = PRUnichar(240);
else if (entityStr.EqualsIgnoreCase("&ntilde;")) entityChar = PRUnichar(241);
else if (entityStr.EqualsIgnoreCase("&ograve;")) entityChar = PRUnichar(242);
else if (entityStr.EqualsIgnoreCase("&oacute;")) entityChar = PRUnichar(243);
else if (entityStr.EqualsIgnoreCase("&ocirc;")) entityChar = PRUnichar(244);
else if (entityStr.EqualsIgnoreCase("&otilde;")) entityChar = PRUnichar(245);
else if (entityStr.EqualsIgnoreCase("&ouml;")) entityChar = PRUnichar(246);
else if (entityStr.EqualsIgnoreCase("&divide;")) entityChar = PRUnichar(247);
else if (entityStr.EqualsIgnoreCase("&oslash;")) entityChar = PRUnichar(248);
else if (entityStr.EqualsIgnoreCase("&ugrave;")) entityChar = PRUnichar(249);
else if (entityStr.EqualsIgnoreCase("&uacute;")) entityChar = PRUnichar(250);
else if (entityStr.EqualsIgnoreCase("&ucirc;")) entityChar = PRUnichar(251);
else if (entityStr.EqualsIgnoreCase("&uuml;")) entityChar = PRUnichar(252);
else if (entityStr.EqualsIgnoreCase("&yacute;")) entityChar = PRUnichar(253);
else if (entityStr.EqualsIgnoreCase("&thorn;")) entityChar = PRUnichar(254);
else if (entityStr.EqualsIgnoreCase("&yuml;")) entityChar = PRUnichar(255);
startOffset = ampOffset;
if (entityChar != 0)