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

git-svn-id: svn://10.0.0.236/trunk@92133 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nhotta%netscape.com
2001-04-12 23:57:18 +00:00
parent 2971a81712
commit 0bef4f6581
2 changed files with 14 additions and 4 deletions

View File

@@ -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;
}
}
}
}