fix bug 93343 so we can display UTF-16 and UTF-32.

r=harishd sr=vidur.
This commit is contained in:
ftang%netscape.com 2001-10-19 20:58:22 +00:00
Родитель 1abd878494
Коммит 936a324053
2 изменённых файлов: 12 добавлений и 10 удалений

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

@ -2392,11 +2392,12 @@ ParserWriteFunc(nsIInputStream* in,
// Only continue if it's a recognized charset and not
// one of a designated set that we ignore.
if (NS_SUCCEEDED(result) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32LE"))) {
((kCharsetFromByteOrderMark == guessSource) ||
(!preferred.Equals(NS_LITERAL_STRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32LE"))))) {
guess.Assign(preferred);
pws->mParser->SetDocumentCharset(guess, guessSource);
pws->mParser->SetSinkCharset(guess);

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

@ -2392,11 +2392,12 @@ ParserWriteFunc(nsIInputStream* in,
// Only continue if it's a recognized charset and not
// one of a designated set that we ignore.
if (NS_SUCCEEDED(result) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32LE"))) {
((kCharsetFromByteOrderMark == guessSource) ||
(!preferred.Equals(NS_LITERAL_STRING("UTF-16")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-16LE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32BE")) &&
!preferred.Equals(NS_LITERAL_STRING("UTF-32LE"))))) {
guess.Assign(preferred);
pws->mParser->SetDocumentCharset(guess, guessSource);
pws->mParser->SetSinkCharset(guess);