Changed to ignore encoding="UTF-16" in detectByteOrderMark(), bug 66807, r=ftang, sr=erik.

This commit is contained in:
nhotta%netscape.com 2001-04-12 23:57:18 +00:00
Родитель e61e07de9e
Коммит 0755bf7881
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -2206,8 +2206,13 @@ static PRBool detectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
if(kNotFound != encEnd) {
PRInt32 count = encEnd - encStart -1;
if(count >0) {
firstXbytes.Mid(oCharset,(encStart+1), count);
oCharsetSource= kCharsetFromMetaTag;
const PRUnichar *u = firstXbytes.GetUnicode();
// if UTF-16, it should have been detected by now
// otherwise, the label must be invalid
if (nsCRT::strncasecmp(&u[encStart+1], NS_LITERAL_STRING("UTF-16").get(), count)) {
firstXbytes.Mid(oCharset,(encStart+1), count);
oCharsetSource= kCharsetFromMetaTag;
}
}
}
}

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

@ -2206,8 +2206,13 @@ static PRBool detectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
if(kNotFound != encEnd) {
PRInt32 count = encEnd - encStart -1;
if(count >0) {
firstXbytes.Mid(oCharset,(encStart+1), count);
oCharsetSource= kCharsetFromMetaTag;
const PRUnichar *u = firstXbytes.GetUnicode();
// if UTF-16, it should have been detected by now
// otherwise, the label must be invalid
if (nsCRT::strncasecmp(&u[encStart+1], NS_LITERAL_STRING("UTF-16").get(), count)) {
firstXbytes.Mid(oCharset,(encStart+1), count);
oCharsetSource= kCharsetFromMetaTag;
}
}
}
}